1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-28 02:37:09 +00:00

Revert "nix: make channel entries for NIX_PATH dynamic"

This reverts commit 95fb1cb2aa, 1324ccf2c1 and e5c988edf1.
This commit is contained in:
Daiderd Jordan 2018-10-26 18:04:08 +01:00
parent 63dfbc93d5
commit 0146366b21
No known key found for this signature in database
GPG key ID: D02435D05B810C96
3 changed files with 6 additions and 31 deletions

View file

@ -1,10 +1,3 @@
2018-10-26
- the nix.nixPath option no longer includes the paths for channels, these are
added dynamically instead to avoid warnings. This can be disabled using the
following option.
nix.enableChannels = false;
2018-03-29
- default nix.package no longer uses the default profile.
system.stateVersion > 2

View file

@ -315,23 +315,13 @@ in
default =
[ # Include default path <darwin-config>.
"darwin-config=${config.environment.darwinConfig}"
"/nix/var/nix/profiles/per-user/root/channels"
"$HOME/.nix-defexpr/channels"
];
description = ''
The default Nix expression search path, used by the Nix
evaluator to look up paths enclosed in angle brackets
(e.g. <literal>&lt;nixpkgs&gt;</literal>). This value gets
extended with user and/or root channels if those exist and
nix.enableChannels isn't disabled.
'';
};
nix.enableChannels = mkOption {
type = types.bool;
default = true;
description = ''
Whether to extend <envar>NIX_PATH</envar> with <filename>~/.nix-defexpr/channels</filename>
and <filename>/nix/var/nix/profiles/per-user/root/channels</filename>
if they exist.
(e.g. <literal>&lt;nixpkgs&gt;</literal>).
'';
};
};
@ -404,14 +394,6 @@ in
if [ ! -w /nix/var/nix/db ]; then
export NIX_REMOTE=daemon
fi
'' + optionalString cfg.enableChannels ''
# Set up NIX_PATH with root and/or user channels.
if [ -d "$HOME/.nix-defexpr/channels" ]; then
export NIX_PATH="''${NIX_PATH:+$NIX_PATH:}$HOME/.nix-defexpr/channels"
fi
if [ -d /nix/var/nix/profiles/per-user/root/channels ]; then
export NIX_PATH="''${NIX_PATH:+$NIX_PATH:}/nix/var/nix/profiles/per-user/root/channels"
fi
'';
# Set up the environment variables for running Nix.

View file

@ -81,7 +81,7 @@ let
'';
nixPath = ''
darwinConfig=$(NIX_PATH="${concatStringsSep ":" config.nix.nixPath}${optionalString config.nix.enableChannels ":$HOME/.nix-defexpr/channels:/nix/var/nix/profiles/per-user/root/channels"}" nix-instantiate --eval -E '<darwin-config>' || echo "$HOME/.nixpkgs/darwin-configuration.nix") || true
darwinConfig=$(NIX_PATH=${concatStringsSep ":" config.nix.nixPath} nix-instantiate --eval -E '<darwin-config>' || echo "$HOME/.nixpkgs/darwin-configuration.nix") || true
if ! test -e "$darwinConfig"; then
echo "error: Changed <darwin-config> but target does not exist, aborting activation" >&2
echo "Create $darwinConfig or set environment.darwinConfig:" >&2
@ -95,7 +95,7 @@ let
exit 2
fi
darwinPath=$(NIX_PATH="${concatStringsSep ":" config.nix.nixPath}${optionalString config.nix.enableChannels ":$HOME/.nix-defexpr/channels:/nix/var/nix/profiles/per-user/root/channels"}" nix-instantiate --eval -E '<darwin>') || true
darwinPath=$(NIX_PATH=${concatStringsSep ":" config.nix.nixPath} nix-instantiate --eval -E '<darwin>') || true
if ! test -e "$darwinPath"; then
echo "error: Changed <darwin> but target does not exist, aborting activation" >&2
echo "Add the darwin repo as a channel or set nix.nixPath:" >&2
@ -109,7 +109,7 @@ let
exit 2
fi
nixpkgsPath=$(NIX_PATH="${concatStringsSep ":" config.nix.nixPath}${optionalString config.nix.enableChannels ":$HOME/.nix-defexpr/channels:/nix/var/nix/profiles/per-user/root/channels"}" nix-instantiate --eval -E '<nixpkgs>') || true
nixpkgsPath=$(NIX_PATH=${concatStringsSep ":" config.nix.nixPath} nix-instantiate --eval -E '<nixpkgs>') || true
if ! test -e "$nixpkgsPath"; then
echo "error: Changed <nixpkgs> but target does not exist, aborting activation" >&2
echo "Add a nixpkgs channel or set nix.nixPath:" >&2