1
0
Fork 0
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:
Emily 2025-02-14 19:05:06 +00:00 committed by GitHub
parent 7da01bc47a
commit 9daae9a67a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -34,6 +34,14 @@ let
home.username = config.users.users.${name}.name; home.username = config.users.users.${name}.name;
home.homeDirectory = config.users.users.${name}.home; 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. # Make activation script use same version of Nix as system as a whole.
# This avoids problems with Nix not being in PATH. # This avoids problems with Nix not being in PATH.
nix.package = config.nix.package; nix.package = config.nix.package;