diff options
Diffstat (limited to 'hosts/eostre')
-rw-r--r-- | hosts/eostre/default.nix | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/hosts/eostre/default.nix b/hosts/eostre/default.nix index 0603341a..5f58e0a0 100644 --- a/hosts/eostre/default.nix +++ b/hosts/eostre/default.nix | |||
@@ -97,5 +97,44 @@ with lib; | |||
97 | 97 | ||
98 | videoDrivers = [ "nvidia" ]; | 98 | videoDrivers = [ "nvidia" ]; |
99 | }; | 99 | }; |
100 | |||
101 | systemd.services = mapAttrs' (userName: _: nameValuePair "home-manager-${userName}" { enable = mkForce false; }) config.home-manager.users; | ||
102 | |||
103 | systemd.user.services."home-manager" = let | ||
104 | cfg = config.home-manager; | ||
105 | in { | ||
106 | description = "Home Manager environment"; | ||
107 | requiredBy = [ "basic.target" ]; | ||
108 | wants = [ "nix-daemon.socket" ]; | ||
109 | after = [ "nix-daemon.socket" ]; | ||
110 | before = [ "basic.target" ]; | ||
111 | |||
112 | environment = optionalAttrs (cfg.backupFileExtension != null) { | ||
113 | HOME_MANAGER_BACKUP_EXT = cfg.backupFileExtension; | ||
114 | } // optionalAttrs cfg.verbose { VERBOSE = "1"; }; | ||
115 | |||
116 | stopIfChanged = false; | ||
117 | |||
118 | serviceConfig = { | ||
119 | Type = "oneshot"; | ||
120 | RemainAfterExit = "yes"; | ||
121 | TimeoutStartSec = 90; | ||
122 | SyslogIdentifier = "hm-activate"; | ||
123 | |||
124 | ExecStart = pkgs.writeScript "hm-activate" '' | ||
125 | #! ${pkgs.runtimeShell} -el | ||
126 | |||
127 | case $USER of | ||
128 | ${concatStringsSep "\n " (mapAttrsToList (_: usercfg: builtins.replaceStrings ["\n"] ["\n "] '' | ||
129 | ${usercfg.home.username}) | ||
130 | ${usercfg.home.activationPackage}/activate | ||
131 | systemctl --user daemon-reload | ||
132 | ;; | ||
133 | '') cfg.users)} | ||
134 | *) exit 0; ;; | ||
135 | esac | ||
136 | ''; | ||
137 | }; | ||
138 | }; | ||
100 | }; | 139 | }; |
101 | } | 140 | } |