From 7a63e7adc4f929d958cd6bb1d784b640a4af6eba Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 13 Jan 2023 21:06:39 +0100 Subject: home-manager late activation --- hosts/eostre/default.nix | 39 --------------------------------------- 1 file changed, 39 deletions(-) (limited to 'hosts') diff --git a/hosts/eostre/default.nix b/hosts/eostre/default.nix index c8964d99..01dee9ae 100644 --- a/hosts/eostre/default.nix +++ b/hosts/eostre/default.nix @@ -96,44 +96,5 @@ with lib; videoDrivers = [ "nvidia" ]; }; - - systemd.services = mapAttrs' (userName: _: nameValuePair "home-manager-${userName}" { enable = mkForce false; }) config.home-manager.users; - - systemd.user.services."home-manager" = let - cfg = config.home-manager; - in { - description = "Home Manager environment"; - wantedBy = [ "basic.target" ]; - before = [ "basic.target" ]; - - environment = optionalAttrs (cfg.backupFileExtension != null) { - HOME_MANAGER_BACKUP_EXT = cfg.backupFileExtension; - } // optionalAttrs cfg.verbose { VERBOSE = "1"; }; - - stopIfChanged = false; - - unitConfig.DefaultDependencies = false; - - serviceConfig = { - Type = "oneshot"; - RemainAfterExit = "yes"; - TimeoutStartSec = 90; - SyslogIdentifier = "hm-activate"; - - ExecStart = pkgs.writeScript "hm-activate" '' - #! ${pkgs.runtimeShell} -el - - case $USER in - ${concatStringsSep "\n " (mapAttrsToList (_: usercfg: builtins.replaceStrings ["\n"] ["\n "] '' - ${usercfg.home.username}) - ${usercfg.home.activationPackage}/activate - systemctl --user daemon-reload - ;; - '') cfg.users)} - *) exit 0; ;; - esac - ''; - }; - }; }; } -- cgit v1.2.3