mirror of
https://github.com/LnL7/nix-darwin.git
synced 2024-12-14 11:57:34 +00:00
environment: add darwinConfig option to set darwin-config in NIX_PATH
This simplifies using a non default configuration.nix without requiring a symlink or redefining NIX_PATH. The nix.nixPath option only defines a default which means defining a value will drop all of the defaults. This is because correct merge behaviour isn't very clear for named entries.
This commit is contained in:
parent
483a906c90
commit
f473b21c9f
2 changed files with 14 additions and 1 deletions
|
@ -63,6 +63,19 @@ in {
|
|||
description = "List of directories to be symlinked in <filename>/run/current-system/sw</filename>.";
|
||||
};
|
||||
|
||||
environment.darwinConfig = mkOption {
|
||||
type = types.either types.path types.str;
|
||||
default = "$HOME/.nixpkgs/darwin-configuration.nix";
|
||||
description = ''
|
||||
The path of the darwin configuration.nix used to configure the system,
|
||||
this updates the default darwin-config entry in NIX_PATH. Since this
|
||||
changes an environment variable it will only apply to new shells.
|
||||
|
||||
NOTE: Changing this requires running <command>darwin-rebuild switch -I darwin-config=/path/to/configuration.nix</command>
|
||||
the first time to make darwin-rebuild aware of the custom location.
|
||||
'';
|
||||
};
|
||||
|
||||
environment.loginShell = mkOption {
|
||||
type = types.str;
|
||||
default = "$SHELL";
|
||||
|
|
|
@ -314,7 +314,7 @@ in
|
|||
type = types.listOf types.str;
|
||||
default =
|
||||
[ # Include default path <darwin-config>.
|
||||
"darwin-config=$HOME/.nixpkgs/darwin-configuration.nix"
|
||||
"darwin-config=${config.environment.darwinConfig}"
|
||||
"/nix/var/nix/profiles/per-user/root/channels"
|
||||
"$HOME/.nix-defexpr/channels"
|
||||
];
|
||||
|
|
Loading…
Reference in a new issue