diff --git a/nix/module-eval/lib.nix b/nix/module-eval/lib.nix index 2b6826f6..2a0b4708 100644 --- a/nix/module-eval/lib.nix +++ b/nix/module-eval/lib.nix @@ -37,11 +37,17 @@ let # Stub host, same shape ./docs/default.nix already uses: enough for a # `nixosSystem` to evaluate, nothing that pulls a real disk or # bootloader in. + # + # Every host fixture reuses the flake's `pkgs` rather than importing its own + # nixpkgs. `read-only.nix` makes any host module that defines top-level + # `nixpkgs.config`/`overlays`/`hostPlatform` fail the fixture's eval instead + # of being ignored. hive = extra: (nixosSystem { - system = pkgs.stdenv.hostPlatform.system; modules = [ + (pkgs.path + "/nixos/modules/misc/nixpkgs/read-only.nix") + { nixpkgs.pkgs = pkgs; } self.nixosModules.default { fileSystems."/" = {