summaryrefslogtreecommitdiff
path: root/hosts/eostre/default.nix
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2022-11-11 18:48:33 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2022-11-11 18:48:33 +0100
commit4a7e77f8f9de052517b7db928312a9dce17e69a5 (patch)
tree06a2ac529d5d7e1f69e9dfecd1279875c512ac64 /hosts/eostre/default.nix
parenta7a2b85a3a45b6c7c3dce3e189fb97be82068b1f (diff)
downloadnixos-4a7e77f8f9de052517b7db928312a9dce17e69a5.tar
nixos-4a7e77f8f9de052517b7db928312a9dce17e69a5.tar.gz
nixos-4a7e77f8f9de052517b7db928312a9dce17e69a5.tar.bz2
nixos-4a7e77f8f9de052517b7db928312a9dce17e69a5.tar.xz
nixos-4a7e77f8f9de052517b7db928312a9dce17e69a5.zip
...
Diffstat (limited to 'hosts/eostre/default.nix')
-rw-r--r--hosts/eostre/default.nix39
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}