diff options
| author | 2026-09-18 15:12:24 +0200 | |
|---|---|---|
| committer | 2026-09-18 15:12:24 +0200 | |
| commit | 4937d0d6f29895b514dcf8cd20c73a1aec446144 (patch) | |
| tree | 7ff388ba4cca94e95489d30452b25badd7e49aa9 /openspec/changes/archive/2026-09-18-add-nix-flake-bootstrap/tasks.md | |
| parent | 72b640f5ae65755c1d932b7b8ee88d2367e4036f (diff) | |
| download | desktop-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/archive/2026-09-18-add-nix-flake-bootstrap/tasks.md')
| -rw-r--r-- | openspec/changes/archive/2026-09-18-add-nix-flake-bootstrap/tasks.md | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/openspec/changes/archive/2026-09-18-add-nix-flake-bootstrap/tasks.md b/openspec/changes/archive/2026-09-18-add-nix-flake-bootstrap/tasks.md new file mode 100644 index 0000000..853a5be --- /dev/null +++ b/openspec/changes/archive/2026-09-18-add-nix-flake-bootstrap/tasks.md | |||
| @@ -0,0 +1,59 @@ | |||
| 1 | ## 1. Flake scaffold | ||
| 2 | |||
| 3 | - [x] 1.1 Create `flake.nix` with `nixpkgs` (nixos-unstable) and `home-manager` (following `nixpkgs`) inputs, and an `outputs` function that imports `lib` and wires `nixosConfigurations`, `homeConfigurations`, `formatter`, and `devShells` — verify with `nix flake metadata` succeeding without errors (**nix not installed locally — command-level verification deferred, see note below**) | ||
| 4 | - [x] 1.2 Add `.gitignore` for `result`/`result-*` symlinks — verify `nix build` output doesn't get tracked by `git status` | ||
| 5 | |||
| 6 | ## 2. Shared lib helpers | ||
| 7 | |||
| 8 | - [x] 2.1 Create `lib/mkNixos.nix` wrapping `nixpkgs.lib.nixosSystem`, taking `{ hostname, system ? "x86_64-linux", users ? [ "tom" ], extraModules ? [] }`, including `modules/nixos/common.nix`, `../hosts/${hostname}`, and `home-manager.nixosModules.home-manager` with `home-manager.users.<u> = import ../users/${u}.nix` for each user, and `specialArgs = { inherit inputs; }` — verify by importing it in a `nix repl` and checking it returns a function (**deferred, no local nix**) (**correction, 2026-09-18: a real `nixos-rebuild switch` on an actual host surfaced that this file used a non-existent option, `home-manager.useUserHomeDirectory` — the manual review above missed it since it was never actually evaluated until now. Fixed to the correct, standard option `home-manager.useUserPackages` (which Nix's own error message suggested). This is the first concrete evidence that "verified by manual review" was not a substitute for real evaluation — flagging for awareness on any other task in this repo marked complete under the same no-local-Nix constraint.**) | ||
| 9 | - [x] 2.2 Create `lib/mkHome.nix` wrapping `home-manager.lib.homeManagerConfiguration`, taking `{ username, system, extraModules ? [] }`, using `pkgs = nixpkgs.legacyPackages.${system}` and `modules = [ ../users/${username}.nix ] ++ extraModules` — verify the same way (**deferred, no local nix**) | ||
| 10 | - [x] 2.3 Create `lib/default.nix` aggregating both as `{ mkNixos, mkHome }` given `{ inputs }` — verify `flake.nix` can `import ./lib { inherit inputs; }` without eval errors (**deferred, no local nix**) | ||
| 11 | |||
| 12 | ## 3. Shared NixOS module | ||
| 13 | |||
| 14 | - [x] 3.1 Create `modules/nixos/common.nix` with `nix.settings.experimental-features = [ "nix-command" "flakes" ]`, a `tom` user skeleton (`isNormalUser = true`, `extraGroups = [ "wheel" ]`, `shell = pkgs.zsh`), default locale/timezone, and `nix.gc` policy — verify it evaluates standalone via `nix eval --file modules/nixos/common.nix` (or as part of the template host eval in task 5) (**deferred, no local nix**) | ||
| 15 | |||
| 16 | ## 4. Shared home-manager profile | ||
| 17 | |||
| 18 | - [x] 4.1 Create `modules/home/git.nix` with `programs.git.enable = true`, `userName`, and `userEmail` sourced from options set in `users/tom.nix` (not hardcoded in the module itself), plus `init.defaultBranch = "main"` and `pull.rebase = true` | ||
| 19 | - [x] 4.2 Create `modules/home/shell.nix` with `programs.zsh.enable = true` (`autosuggestion.enable`, `syntaxHighlighting.enable`), `programs.starship.enable = true`, and `programs.direnv.enable = true` with `nix-direnv.enable = true` | ||
| 20 | - [x] 4.3 Create `modules/home/editor.nix` with `programs.neovim.enable = true`, `defaultEditor = true`, `vimAlias = true` | ||
| 21 | - [x] 4.4 Create `modules/home/cli-tools.nix` with `home.packages` including `ripgrep`, `fd`, `bat`, `eza`, `jq`, `fzf`, `tree` | ||
| 22 | - [x] 4.5 Create `modules/home/default.nix` importing the four modules above — verify by building `homeConfigurations."tom@linux"` in task 6 and confirming all four programs appear in the activation package (**deferred, no local nix**) | ||
| 23 | |||
| 24 | ## 5. User identity module | ||
| 25 | |||
| 26 | - [x] 5.1 Create `users/tom.nix` setting `home.username = "tom"`, `home.homeDirectory = if pkgs.stdenv.isDarwin then "/Users/tom" else "/home/tom"`, `programs.git.userEmail = "t0m.vd.l33@gmail.com"`, `home.stateVersion` (pin to the current home-manager release), and importing `modules/home` — verify it evaluates under both a NixOS host context and standalone `mkHome` without error (**deferred, no local nix; stateVersion pinned to "24.05" — confirm/bump to your actual install-time release before first activation**) | ||
| 27 | |||
| 28 | ## 6. Standalone home-manager output | ||
| 29 | |||
| 30 | - [x] 6.1 Add `homeConfigurations."tom@linux" = lib.mkHome { username = "tom"; system = "x86_64-linux"; };` to `flake.nix` — verify with `nix build .#homeConfigurations."tom@linux".activationPackage` succeeding without `--impure` (**deferred, no local nix**) | ||
| 31 | |||
| 32 | ## 7. NixOS host template (copy-source only) | ||
| 33 | |||
| 34 | - [x] 7.1 Create `hosts/template/configuration.nix` with placeholders/comments for `networking.hostName`, boot loader choice, and `system.stateVersion`, importing nothing that requires real hardware | ||
| 35 | - [x] 7.2 Create `hosts/template/hardware-configuration.nix` as a stub importing `(modulesPath + "/installer/scan/not-detected.nix")` with commented example `fileSystems`/`boot.initrd.availableKernelModules` entries, clearly marked as "replace with the output of `nixos-generate-config`" | ||
| 36 | - [x] 7.3 Confirm `hosts/template` is not referenced by any `nixosConfigurations` entry in `flake.nix` — verify by grepping `flake.nix` for `template` and finding no matches (grep confirmed: only a comment mentions "template", no output reference) | ||
| 37 | |||
| 38 | ## 8. Repo tooling | ||
| 39 | |||
| 40 | - [x] 8.1 Add `formatter.<system> = pkgs.nixfmt-rfc-style;` to `flake.nix` — verify with `nix fmt` running successfully across the repo (**deferred, no local nix**) | ||
| 41 | - [x] 8.2 Add `devShells.default` with `statix` and `deadnix` available — verify `nix develop -c statix check .` and `nix develop -c deadnix .` both run (**deferred, no local nix**) | ||
| 42 | |||
| 43 | ## 9. Validation | ||
| 44 | |||
| 45 | - [x] 9.1 Run `nix flake check` and confirm it passes without `--impure`, covering `lib`, `homeConfigurations."tom@linux"`, `formatter`, and `devShells` (**blocked — nix not installed locally; no fallback verification possible. Run this once Nix is available.**) (run by the user on a Linux machine with Nix, 2026-09-18: `nix flake check` passed with no errors — only benign warnings, `nixfmt-rfc-style`/missing `apps.*.meta` since fixed in a later change, and the expected "omitted incompatible systems" notice since the run was on a single system without `--all-systems`) | ||
| 46 | - [x] 9.2 Manually review `flake.nix` and confirm `nixosConfigurations` is empty (or absent) in this change, per the design decision not to expose the unbuilt template (confirmed: `nixosConfigurations = { };`) | ||
| 47 | |||
| 48 | ## 10. Documentation | ||
| 49 | |||
| 50 | - [x] 10.1 Write `README.md` documenting the repo layout, the NixOS install workflow (manual partition/format → `nixos-generate-config` → copy `hosts/template` → `nixos-install --flake`), and the standalone workflow (install Nix → `home-manager switch --flake`) — verify by following each documented command sequence mentally against the actual files created in this change for consistency | ||
| 51 | - [x] 10.2 Note in the README, as explicit follow-up items not covered by this change: pushing the repo to a remote (required before `nixos-install` can clone it), adding a real NixOS host, adding nix-darwin for a real Mac host, and adding secrets management | ||
| 52 | |||
| 53 | ## 11. Commit | ||
| 54 | |||
| 55 | - [x] 11.1 `git add` all new files (`flake.nix`, `flake.lock`, `lib/`, `modules/`, `hosts/`, `users/`, `README.md`, `.gitignore`) and create the initial commit — verify with `git status` showing a clean tree and `git log` showing the commit, which also makes the flake's files visible to the Nix evaluator for the first time (**note: no `flake.lock` yet — it can only be generated by `nix flake lock`/`nix flake check`, which require Nix; committed without it, will be created on first `nix` invocation**) (committed as `d7acead`, staged/committed by the user due to a sandbox restriction on `.git/index.lock`; `git status` confirms a clean tree, `git log` confirms the commit) | ||
| 56 | |||
| 57 | --- | ||
| 58 | |||
| 59 | **Verification note:** Nix is not installed on this machine (confirmed via `which nix`), so none of the `nix flake check` / `nix build` / `nix repl` / `nix fmt` / `nix develop` verification commands above could actually be run. Per explicit user decision, all file-creation tasks are marked complete based on careful manual construction against the Nix/home-manager module system semantics, but **task 9.1 (the full `nix flake check`) remains unexecuted and should be run as soon as Nix is available** — treat that as the real acceptance gate for this change, not the individual checkboxes above. | ||
