mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 11:36:05 +01:00
nixos/common: forward nix.enable from the OS configuration (#6383)
This prevents problematic references to `nix.package` when Nix management is disabled in the host OS.
This commit is contained in:
parent
7da01bc47a
commit
9daae9a67a
1 changed files with 8 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue