1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-04-09 02:30:29 +00:00

Merge pull request #87 from kirelagin/clean-path

installer and activation: Sanitise PATH
This commit is contained in:
Daiderd Jordan 2018-08-01 19:23:49 +02:00 committed by GitHub
commit 5702b212b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View file

@ -40,7 +40,7 @@ in
#! ${stdenv.shell}
set -e
set -o pipefail
export PATH=${pkgs.coreutils}/bin:@out@/sw/bin:${config.environment.systemPath}
export PATH="${pkgs.gnugrep}/bin:${pkgs.coreutils}/bin:@out@/sw/bin:/usr/bin:/bin"
systemConfig=@out@
@ -83,7 +83,7 @@ in
#! ${stdenv.shell}
set -e
set -o pipefail
export PATH=${pkgs.coreutils}/bin:@out@/sw/bin:${config.environment.systemPath}
export PATH="${pkgs.gnugrep}/bin:${pkgs.coreutils}/bin:@out@/sw/bin:/usr/bin:/bin"
systemConfig=@out@

View file

@ -24,6 +24,9 @@ stdenv.mkDerivation {
shellHook = ''
set -e
orig_path="$PATH"
export PATH="${pkgs.openssh}/bin:/usr/bin:/bin" # ssh in case nix needs it
action=switch
while [ "$#" -gt 0 ]; do
i="$1"; shift 1
@ -58,7 +61,7 @@ stdenv.mkDerivation {
read -p "Would you like edit the default configuration.nix before starting? [y/n] " i
case "$i" in
y|Y)
''${EDITOR:-nano} "$config"
PATH="$orig_path" ''${EDITOR:-nano} "$config"
;;
esac
fi