mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 11:39:46 +01:00
Changing from `sudo -i` to `sudo -s` messes up activation when multiple
users are managed. `--set-home` should have similar behavior to `-i` in
that the activation script is run from the user's home directory.
Fixes #2856
(cherry picked from commit e1fab012e8
)
Co-authored-by: toonn <toonn@toonn.io>
This commit is contained in:
parent
ef6b316265
commit
0bdbdea2e2
1 changed files with 1 additions and 1 deletions
|
@ -134,7 +134,7 @@ in
|
|||
system.activationScripts.postActivation.text =
|
||||
concatStringsSep "\n" (mapAttrsToList (username: usercfg: ''
|
||||
echo Activating home-manager configuration for ${username}
|
||||
sudo -u ${username} -s ${pkgs.writeShellScript "activation-${username}" ''
|
||||
sudo -u ${username} -s --set-home ${pkgs.writeShellScript "activation-${username}" ''
|
||||
${lib.optionalString (cfg.backupFileExtension != null)
|
||||
"export HOME_MANAGER_BACKUP_EXT=${lib.escapeShellArg cfg.backupFileExtension}"}
|
||||
${lib.optionalString cfg.verbose "export VERBOSE=1"}
|
||||
|
|
Loading…
Reference in a new issue