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 != { }) {
system.activationScripts.postActivation.text = concatStringsSep "\n"
(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