summaryrefslogtreecommitdiff
path: root/hosts
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2023-01-13 21:06:39 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2023-01-13 21:06:39 +0100
commit7a63e7adc4f929d958cd6bb1d784b640a4af6eba (patch)
tree772705e701aac9de1bff506205c8b0d410ca8a35 /hosts
parent79004a0077ad0d584859e39bf7ec881e4ae67999 (diff)
downloadnixos-7a63e7adc4f929d958cd6bb1d784b640a4af6eba.tar
nixos-7a63e7adc4f929d958cd6bb1d784b640a4af6eba.tar.gz
nixos-7a63e7adc4f929d958cd6bb1d784b640a4af6eba.tar.bz2
nixos-7a63e7adc4f929d958cd6bb1d784b640a4af6eba.tar.xz
nixos-7a63e7adc4f929d958cd6bb1d784b640a4af6eba.zip
home-manager late activation
Diffstat (limited to 'hosts')
-rw-r--r--hosts/eostre/default.nix39
1 files changed, 0 insertions, 39 deletions
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;
96 96
97 videoDrivers = [ "nvidia" ]; 97 videoDrivers = [ "nvidia" ];
98 }; 98 };
99
100 systemd.services = mapAttrs' (userName: _: nameValuePair "home-manager-${userName}" { enable = mkForce false; }) config.home-manager.users;
101
102 systemd.user.services."home-manager" = let
103 cfg = config.home-manager;
104 in {
105 description = "Home Manager environment";
106 wantedBy = [ "basic.target" ];
107 before = [ "basic.target" ];
108
109 environment = optionalAttrs (cfg.backupFileExtension != null) {
110 HOME_MANAGER_BACKUP_EXT = cfg.backupFileExtension;
111 } // optionalAttrs cfg.verbose { VERBOSE = "1"; };
112
113 stopIfChanged = false;
114
115 unitConfig.DefaultDependencies = false;
116
117 serviceConfig = {
118 Type = "oneshot";
119 RemainAfterExit = "yes";
120 TimeoutStartSec = 90;
121 SyslogIdentifier = "hm-activate";
122
123 ExecStart = pkgs.writeScript "hm-activate" ''
124 #! ${pkgs.runtimeShell} -el
125
126 case $USER in
127 ${concatStringsSep "\n " (mapAttrsToList (_: usercfg: builtins.replaceStrings ["\n"] ["\n "] ''
128 ${usercfg.home.username})
129 ${usercfg.home.activationPackage}/activate
130 systemctl --user daemon-reload
131 ;;
132 '') cfg.users)}
133 *) exit 0; ;;
134 esac
135 '';
136 };
137 };
138 }; 99 };
139} 100}