diff options
| author | Roman Novak <rawman.novak@gmail.com> | 2023-11-06 10:24:41 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-06 10:24:41 +0100 |
| commit | 26a59d504b69448c1a7f1527ffc3f5e4999821fb (patch) | |
| tree | d67eb668cfe074fd3ed24e6160e63eb7573b3fd5 /pkgs | |
| parent | afe83cbc2e673b1f08d32dd0f70df599678ff1e7 (diff) | |
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
Diffstat (limited to 'pkgs')
| -rw-r--r-- | pkgs/nix-tools/darwin-rebuild.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pkgs/nix-tools/darwin-rebuild.sh b/pkgs/nix-tools/darwin-rebuild.sh index f9d0599..b1b227a 100644 --- a/pkgs/nix-tools/darwin-rebuild.sh +++ b/pkgs/nix-tools/darwin-rebuild.sh @@ -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 |
