1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-03-20 23:30:07 +00:00

nix-darwin: respect username setting of home-manager in activation script (#5881)

This commit is contained in:
Lynn 2025-03-11 14:53:55 +01:00 committed by GitHub
parent 7fd6dc2b94
commit c630dfa8ab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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