Skip to content

Commit

Permalink
nixos/common: forward nix.enable from the OS configuration (#6383)
Browse files Browse the repository at this point in the history
This prevents problematic references to `nix.package` when Nix
management is disabled in the host OS.
  • Loading branch information
emilazy authored Feb 14, 2025
1 parent 7da01bc commit 9daae9a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions nixos/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ let
home.username = config.users.users.${name}.name;
home.homeDirectory = config.users.users.${name}.home;

# Forward `nix.enable` from the OS configuration. The
# conditional is to check whether nix-darwin is new enough
# to have the `nix.enable` option; it was previously a
# `mkRemovedOptionModule` error, which we can crudely detect
# by `visible` being set to `false`.
nix.enable =
mkIf (options.nix.enable.visible or true) config.nix.enable;

# Make activation script use same version of Nix as system as a whole.
# This avoids problems with Nix not being in PATH.
nix.package = config.nix.package;
Expand Down

0 comments on commit 9daae9a

Please sign in to comment.