1
0
Fork 0
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:
Roman Novak 2023-11-06 10:24:41 +01:00 committed by GitHub
parent afe83cbc2e
commit 26a59d504b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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