mirror of
https://github.com/LnL7/nix-darwin.git
synced 2024-12-14 11:57:34 +00:00
fix(#798): darwin-rebuild support for Cyberark EPM
restore sudo environment PATH when Cyberark EPM is setting secure_path in sudo config. Fixes LnL7/nix-darwin/issues/798
This commit is contained in:
parent
afe83cbc2e
commit
26a59d504b
1 changed files with 3 additions and 3 deletions
|
@ -187,7 +187,7 @@ fi
|
|||
|
||||
if [ "$action" = list ] || [ "$action" = rollback ]; then
|
||||
if [ "$USER" != root ] && [ ! -w $(dirname "$profile") ]; then
|
||||
sudo -H nix-env -p "$profile" "${extraProfileFlags[@]}"
|
||||
sudo -H --preserve-env=PATH env nix-env -p "$profile" "${extraProfileFlags[@]}"
|
||||
else
|
||||
nix-env -p "$profile" "${extraProfileFlags[@]}"
|
||||
fi
|
||||
|
@ -205,7 +205,7 @@ if [ -z "$systemConfig" ]; then exit 0; fi
|
|||
|
||||
if [ "$action" = switch ]; then
|
||||
if [ "$USER" != root ] && [ ! -w $(dirname "$profile") ]; then
|
||||
sudo -H nix-env -p "$profile" --set "$systemConfig"
|
||||
sudo -H --preserve-env=PATH env nix-env -p "$profile" --set "$systemConfig"
|
||||
else
|
||||
nix-env -p "$profile" --set "$systemConfig"
|
||||
fi
|
||||
|
@ -215,7 +215,7 @@ if [ "$action" = switch ] || [ "$action" = activate ] || [ "$action" = rollback
|
|||
"$systemConfig/activate-user"
|
||||
|
||||
if [ "$USER" != root ]; then
|
||||
sudo -H "$systemConfig/activate"
|
||||
sudo -H --preserve-env=PATH env "$systemConfig/activate"
|
||||
else
|
||||
"$systemConfig/activate"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue