1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2024-12-15 17:50:53 +00:00

nix-darwin: respect username setting of home-manager in activation script

This commit is contained in:
Lynn 2024-09-22 15:57:02 +02:00
parent 04213d1ce4
commit 003761539c

View file

@ -14,9 +14,9 @@ in {
(mkIf (cfg.users != { }) { (mkIf (cfg.users != { }) {
system.activationScripts.postActivation.text = concatStringsSep "\n" system.activationScripts.postActivation.text = concatStringsSep "\n"
(mapAttrsToList (username: usercfg: '' (mapAttrsToList (username: usercfg: ''
echo Activating home-manager configuration for ${username} echo Activating home-manager configuration for ${usercfg.home.username}
sudo -u ${username} --set-home ${ sudo -u ${usercfg.home.username} --set-home ${
pkgs.writeShellScript "activation-${username}" '' pkgs.writeShellScript "activation-${usercfg.home.username}" ''
${lib.optionalString (cfg.backupFileExtension != null) ${lib.optionalString (cfg.backupFileExtension != null)
"export HOME_MANAGER_BACKUP_EXT=${ "export HOME_MANAGER_BACKUP_EXT=${
lib.escapeShellArg cfg.backupFileExtension lib.escapeShellArg cfg.backupFileExtension