1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-13 20:30:02 +00:00

nix: make nix.nixPath merge by default

Since named entries can be overridden now based on ordering now merging
is only a problem for removing one of the default search paths, in which
case a higher priority eg. mkForce can be used.

	{
	  nix.nixPath = [{ darwin-config = "/darwin.nix"; }];
	}

Will result in

	[ "darwin-config=/darwin.nix" "/nix/var/nix/profiles/per-user/root/channels" "$HOME/.nix-defexpr/channels" ]

Fixes #137
This commit is contained in:
Daiderd Jordan 2019-05-01 12:42:31 +02:00
parent 4d235b800d
commit 58aa5bf185
No known key found for this signature in database
GPG key ID: D02435D05B810C96
4 changed files with 12 additions and 5 deletions

View file

@ -25,7 +25,7 @@ with lib;
# Used for backwards compatibility, please read the changelog before changing.
# $ darwin-rebuild changelog
system.stateVersion = 3;
system.stateVersion = 4;
# You should generally set this to the total number of logical cores in your system.
# $ sysctl -n hw.ncpu

View file

@ -22,7 +22,7 @@
# Used for backwards compatibility, please read the changelog before changing.
# $ darwin-rebuild changelog
system.stateVersion = 3;
system.stateVersion = 4;
# You should generally set this to the total number of logical cores in your system.
# $ sysctl -n hw.ncpu

View file

@ -363,11 +363,18 @@ in
nix.binaryCaches = mkAfter [ https://cache.nixos.org/ ];
nix.binaryCachePublicKeys = mkAfter [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" ];
nix.nixPath = mkIf (config.system.stateVersion < 2) (mkDefault
nix.nixPath = mkMerge [
(mkIf (config.system.stateVersion < 2) (mkDefault
[ "darwin=$HOME/.nix-defexpr/darwin"
"darwin-config=$HOME/.nixpkgs/darwin-configuration.nix"
"/nix/var/nix/profiles/per-user/root/channels"
]);
]))
(mkIf (config.system.stateVersion > 3) (mkOrder 1200
[ { darwin-config = "${config.environment.darwinConfig}"; }
"/nix/var/nix/profiles/per-user/root/channels"
"$HOME/.nix-defexpr/channels"
]))
];
nix.package = mkIf (config.system.stateVersion < 3)

View file

@ -26,7 +26,7 @@ in
options = {
system.stateVersion = mkOption {
type = types.int;
default = 3;
default = 4;
description = ''
Every once in a while, a new NixOS release may change
configuration defaults in a way incompatible with stateful