1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-06 16:57:08 +00:00
nix-darwin/modules/nix
Emily cd445c5465 nix: catch reads of unmanaged defaults
When we’re not managing the Nix installation, these defaults
aren’t used out of the box and won’t accurately represent the
state of any unmanaged Nix or the desired Nix package, so reading
the option defaults is a bug.

This was previously a warning for `nix.package` and a silent failure
for all the others. Now that all the problematic accesses in nix-darwin
have been appropriately conditionalized, and since a throw gives a
backtrace where a warning doesn’t, give throwing defaults to all the
`nix.*` options that don’t reflect reality and that that modules
shouldn’t be reading when `nix.enable` is off.

I’m not in love with the implementation strategy here… ideally
we’d think of something better than this and then upstream it to
NixOS. `nix.nrBuildUsers` growing a fake default that is never used
is particularly unfortunate. But this should hopefully catch mistakes
in module code reasonably reliably.
2025-02-11 20:10:55 +00:00
..
default.nix nix: catch reads of unmanaged defaults 2025-02-11 20:10:55 +00:00
linux-builder.nix linux-builder: check for nix.enable 2025-02-11 20:10:55 +00:00
nix-darwin.nix nix-tools: only pass config.nix.nixPath through if nix.enable 2025-02-11 20:10:55 +00:00
nixpkgs-flake.nix nixpkgs-flake: check for nix.enable 2025-02-11 20:10:55 +00:00
nixpkgs.nix Revert "nixpkgs: make config.nixpkgs.{buildPlatform,hostPlatform} write only" 2025-02-05 22:06:04 +00:00