mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-13 20:30:02 +00:00
comment
This commit is contained in:
parent
7d26a5f249
commit
93800d2951
1 changed files with 6 additions and 5 deletions
|
@ -226,11 +226,12 @@ fi
|
|||
|
||||
if [ "$action" = switch ] || [ "$action" = activate ] || [ "$action" = rollback ]; then
|
||||
if [ "$USER" != root ]; then
|
||||
# Running `$systemConfig/activate-user` causes subsequent sudo invocations to prompt
|
||||
# for the password even if we previously ran sudo in the same session; indeed, by this
|
||||
# point we've already run `nix-env --set` as sudo. To avoid prompting a second time,
|
||||
# we become root *before* running activate-user and then drop down to the user to
|
||||
# invoke it. This way, the call to activate doesn't require a password.
|
||||
# Running `$systemConfig/activate-user` may cause subsequent sudo invocations to prompt
|
||||
# for the password even if we previously ran sudo in the same session, since `brew` resets
|
||||
# the sudo timestamp: see https://github.com/Homebrew/brew/pull/17694.
|
||||
# Indeed, by this point we've already run `nix-env --set` as sudo. So to avoid prompting a
|
||||
# second time, we become root *before* running activate-user and then drop down to the user
|
||||
# to invoke it. This way, the call to `activate` doesn't require a password.
|
||||
sudo @shell@ -c "$sudo_base -u $USER $systemConfig/activate-user && $systemConfig/activate"
|
||||
else
|
||||
"$systemConfig/activate-user"
|
||||
|
|
Loading…
Add table
Reference in a new issue