aboutsummaryrefslogtreecommitdiffstats
path: root/openspec/changes/add-host-bootstrap-script/specs
diff options
context:
space:
mode:
authorGravatar Tom van der Lee <tom@vanderlee.io>2026-09-18 15:12:24 +0200
committerGravatar Tom van der Lee <tom@vanderlee.io>2026-09-18 15:12:24 +0200
commit4937d0d6f29895b514dcf8cd20c73a1aec446144 (patch)
tree7ff388ba4cca94e95489d30452b25badd7e49aa9 /openspec/changes/add-host-bootstrap-script/specs
parent72b640f5ae65755c1d932b7b8ee88d2367e4036f (diff)
downloaddesktop-flake-4937d0d6f29895b514dcf8cd20c73a1aec446144.tar.gz
desktop-flake-4937d0d6f29895b514dcf8cd20c73a1aec446144.tar.bz2
desktop-flake-4937d0d6f29895b514dcf8cd20c73a1aec446144.zip
Archive four completed changes, sync main specs
add-nix-flake-bootstrap, add-host-bootstrap-script, add-dotfiles-stow-bootstrap, and add-developer-environment all had every task complete (verified via a real nix flake check and a real NixOS host build). Archived in dependency order so the two changes sharing the nix-flake-bootstrap capability merged additively. Main specs now exist for the first time: nix-flake-bootstrap (10 requirements), dotfiles-management (4), developer-environment (4). add-gnome-desktop remains active (not yet implemented).
Diffstat (limited to 'openspec/changes/add-host-bootstrap-script/specs')
-rw-r--r--openspec/changes/add-host-bootstrap-script/specs/nix-flake-bootstrap/spec.md49
1 files changed, 0 insertions, 49 deletions
diff --git a/openspec/changes/add-host-bootstrap-script/specs/nix-flake-bootstrap/spec.md b/openspec/changes/add-host-bootstrap-script/specs/nix-flake-bootstrap/spec.md
deleted file mode 100644
index 3203b99..0000000
--- a/openspec/changes/add-host-bootstrap-script/specs/nix-flake-bootstrap/spec.md
+++ /dev/null
@@ -1,49 +0,0 @@
1## Purpose
2
3Provides a single Nix flake that provisions NixOS hosts from a copyable template and provisions a shared, cross-platform home-manager user profile that installs standalone on non-NixOS systems, keeping both paths built from the same per-user module.
4
5## ADDED Requirements
6
7### Requirement: Host directories are auto-discovered as flake outputs
8Any directory under `hosts/` other than `hosts/template` that contains a valid host definition SHALL automatically become a `nixosConfigurations.<name>` output, without requiring any edit to `flake.nix`.
9
10#### Scenario: New host directory becomes buildable without touching flake.nix
11- **WHEN** a new directory `hosts/<name>/` is created containing `configuration.nix`, `hardware-configuration.nix`, and a `system` file, and `flake.nix` itself is left unmodified
12- **THEN** `nixosConfigurations.<name>` evaluates successfully as part of the flake's outputs
13
14#### Scenario: Template remains excluded from discovery
15- **WHEN** the flake's outputs are evaluated
16- **THEN** `hosts/template` does not appear as a `nixosConfigurations` entry, regardless of its contents
17
18### Requirement: Host creation is scripted
19The system SHALL provide a script that scaffolds a new NixOS host directory from the template, given a hostname, a target root path, and a state version.
20
21#### Scenario: Scaffolding a new host
22- **WHEN** the host creation script is run with a hostname, a `--root` path, and a `--state-version`
23- **THEN** a `hosts/<hostname>/` directory is created containing a `configuration.nix` with the hostname and state version filled in, a `system` file, and a `hardware-configuration.nix` copied from the given root
24
25#### Scenario: Refusing to overwrite an existing host
26- **WHEN** the host creation script is run with a hostname that already has a `hosts/<hostname>/` directory, without an explicit override flag
27- **THEN** the script fails without modifying the existing directory
28
29### Requirement: Hardware configuration source is always explicit
30The host creation script SHALL require an explicit root path for locating `hardware-configuration.nix` and SHALL NOT read from the invoking system's own `/etc/nixos` unless that path is explicitly given as the root.
31
32#### Scenario: No root provided
33- **WHEN** the host creation script is run without a root path specified
34- **THEN** the script fails with an error rather than falling back to any default location
35
36#### Scenario: Live installer environment targets the mounted install, not the live system
37- **WHEN** the host creation script is run from a NixOS live/installer environment with `--root /mnt` pointing at a freshly mounted install target
38- **THEN** the resulting `hardware-configuration.nix` is copied from `/mnt/etc/nixos/hardware-configuration.nix`, and the live environment's own `/etc/nixos/hardware-configuration.nix` is never read
39
40#### Scenario: Hardware configuration cannot be found or generated
41- **WHEN** the host creation script is run with a `--root` path that has no `hardware-configuration.nix` and no `nixos-generate-config` command is available to create one
42- **THEN** the script fails with a clear error instead of proceeding with a missing or stub file
43
44### Requirement: Install target matches the created host name
45The host attribute produced for a newly scaffolded host SHALL exactly match the hostname given to the creation script, so the host can be installed or rebuilt via `<flake>#<hostname>`.
46
47#### Scenario: Installing a newly scaffolded host
48- **WHEN** a host is scaffolded with a given hostname
49- **THEN** `nixos-install --flake <flake-path>#<hostname>` and `nixos-rebuild switch --flake <flake-path>#<hostname>` both resolve to the configuration that was just scaffolded