From c630dfa8abcc65984cc1e47fb25d4552c81dd37e Mon Sep 17 00:00:00 2001 From: Lynn Date: Tue, 11 Mar 2025 14:53:55 +0100 Subject: [PATCH] nix-darwin: respect username setting of home-manager in activation script (#5881) --- nix-darwin/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nix-darwin/default.nix b/nix-darwin/default.nix index 75011da46..7dae50a5c 100644 --- a/nix-darwin/default.nix +++ b/nix-darwin/default.nix @@ -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