From a6d5680c87c31ab6da8dcb7cdeb76e77a02924e1 Mon Sep 17 00:00:00 2001 From: Tom van der Lee Date: Fri, 18 Sep 2026 14:58:29 +0200 Subject: Fix invalid home-manager.useUserHomeDirectory option in mkNixos home-manager.useUserHomeDirectory was never a real option -- a mistake that slipped through because this file was never actually evaluated until a live nixos-rebuild switch surfaced it today. Corrected to useUserPackages, the standard option that pairs with useGlobalPkgs for NixOS+home-manager integration (also what Nix's own error suggested). --- lib/mkNixos.nix | 2 +- openspec/changes/add-nix-flake-bootstrap/tasks.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/mkNixos.nix b/lib/mkNixos.nix index 00f19a0..5f1d8ac 100644 --- a/lib/mkNixos.nix +++ b/lib/mkNixos.nix @@ -9,7 +9,7 @@ inputs.nixpkgs.lib.nixosSystem { inputs.home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; - home-manager.useUserHomeDirectory = true; + home-manager.useUserPackages = true; home-manager.users = builtins.listToAttrs (map (u: { name = u; diff --git a/openspec/changes/add-nix-flake-bootstrap/tasks.md b/openspec/changes/add-nix-flake-bootstrap/tasks.md index 47d476f..853a5be 100644 --- a/openspec/changes/add-nix-flake-bootstrap/tasks.md +++ b/openspec/changes/add-nix-flake-bootstrap/tasks.md @@ -5,7 +5,7 @@ ## 2. Shared lib helpers -- [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. = 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**) +- [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. = 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.**) - [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**) - [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**) -- cgit v1.3