mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-06 00:37:00 +00:00
nix: don’t set $NIX_REMOTE
NixOS doesn’t bother doing this, and Nix already matches this conditional behaviour when `$NIX_REMOTE` is unset.
This commit is contained in:
parent
8f227c405e
commit
9b9c9a57b6
2 changed files with 5 additions and 18 deletions
|
@ -785,21 +785,11 @@ in
|
|||
# Set up the environment variables for running Nix.
|
||||
environment.variables = cfg.envVars // { NIX_PATH = cfg.nixPath; };
|
||||
|
||||
environment.extraInit = mkMerge [
|
||||
(mkIf cfg.channel.enable ''
|
||||
if [ -e "$HOME/.nix-defexpr/channels" ]; then
|
||||
export NIX_PATH="$HOME/.nix-defexpr/channels''${NIX_PATH:+:$NIX_PATH}"
|
||||
fi
|
||||
'')
|
||||
# Not in NixOS module
|
||||
''
|
||||
# Set up secure multi-user builds: non-root users build through the
|
||||
# Nix daemon.
|
||||
if [ ! -w /nix/var/nix/db ]; then
|
||||
export NIX_REMOTE=daemon
|
||||
fi
|
||||
''
|
||||
];
|
||||
environment.extraInit = mkIf cfg.channel.enable ''
|
||||
if [ -e "$HOME/.nix-defexpr/channels" ]; then
|
||||
export NIX_PATH="$HOME/.nix-defexpr/channels''${NIX_PATH:+:$NIX_PATH}"
|
||||
fi
|
||||
'';
|
||||
|
||||
environment.extraSetup = mkIf (!cfg.channel.enable) ''
|
||||
rm --force $out/bin/nix-channel
|
||||
|
|
|
@ -27,8 +27,5 @@ in
|
|||
|
||||
echo checking nix-daemon reload in /activate >&2
|
||||
grep "launchctl kill HUP system/org.nixos.nix-daemon" ${config.out}/activate
|
||||
|
||||
echo checking NIX_REMOTE=daemon in setEnvironment >&2
|
||||
grep "NIX_REMOTE=daemon" ${config.system.build.setEnvironment}
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue