diff --git a/nix-darwin/default.nix b/nix-darwin/default.nix index 7b2b6e6e..bc0e9b60 100644 --- a/nix-darwin/default.nix +++ b/nix-darwin/default.nix @@ -19,7 +19,7 @@ in system.activationScripts.postActivation.text = lib.concatStringsSep "\n" ( lib.mapAttrsToList (username: usercfg: '' echo Activating home-manager configuration for ${usercfg.home.username} - sudo -u ${usercfg.home.username} --set-home ${pkgs.writeShellScript "activation-${usercfg.home.username}" '' + launchctl asuser "$(id -u ${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}"}