Skip to content

Commit

Permalink
Merge pull request NixOS#87 from kirelagin/clean-path
Browse files Browse the repository at this point in the history
installer and activation: Sanitise PATH
  • Loading branch information
LnL7 authored Aug 1, 2018
2 parents 5cdfed8 + 45f0e83 commit 5702b21
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions modules/system/activation-scripts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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@
Expand Down Expand Up @@ -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@
Expand Down
5 changes: 4 additions & 1 deletion pkgs/darwin-installer/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5702b21

Please sign in to comment.