summaryrefslogtreecommitdiff
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
parenta7a2b85a3a45b6c7c3dce3e189fb97be82068b1f (diff)
downloadnixos-4a7e77f8f9de052517b7db928312a9dce17e69a5.tar
nixos-4a7e77f8f9de052517b7db928312a9dce17e69a5.tar.gz
nixos-4a7e77f8f9de052517b7db928312a9dce17e69a5.tar.bz2
nixos-4a7e77f8f9de052517b7db928312a9dce17e69a5.tar.xz
nixos-4a7e77f8f9de052517b7db928312a9dce17e69a5.zip
...
-rw-r--r--accounts/gkleen@eostre.nix12
-rw-r--r--accounts/mherold@eostre.nix12
-rw-r--r--hosts/eostre/default.nix39
3 files changed, 39 insertions, 24 deletions
diff --git a/accounts/gkleen@eostre.nix b/accounts/gkleen@eostre.nix
index 8257d815..e8423976 100644
--- a/accounts/gkleen@eostre.nix
+++ b/accounts/gkleen@eostre.nix
@@ -5,18 +5,6 @@
5 ]; 5 ];
6 6
7 config = { 7 config = {
8 systemd.services."home-manager-${userName}" = {
9 bindsTo = ["home-${userName}.mount"];
10 after = ["home-${userName}.mount"];
11 };
12
13 systemd.mounts = [
14 {
15 where = "/home/${userName}";
16 wants = ["home-manager-${userName}.service"];
17 }
18 ];
19
20 home-manager.users.${userName} = { 8 home-manager.users.${userName} = {
21 nixpkgs.config = { 9 nixpkgs.config = {
22 allowUnfree = true; 10 allowUnfree = true;
diff --git a/accounts/mherold@eostre.nix b/accounts/mherold@eostre.nix
index 287cabd6..9eb9e738 100644
--- a/accounts/mherold@eostre.nix
+++ b/accounts/mherold@eostre.nix
@@ -4,18 +4,6 @@
4 hashedPassword = lib.mkForce "$6$rounds=500000$TaikR1KI4CGveV0a$jLrBjNScflgniUiy87zxQ.IjnyK8K7FbYTW7L0k0EBVrdiImds26WwNjA6DrQpENALwPMzJVIK5BTie17fFVG."; 4 hashedPassword = lib.mkForce "$6$rounds=500000$TaikR1KI4CGveV0a$jLrBjNScflgniUiy87zxQ.IjnyK8K7FbYTW7L0k0EBVrdiImds26WwNjA6DrQpENALwPMzJVIK5BTie17fFVG.";
5 }; 5 };
6 6
7 systemd.services."home-manager-${userName}" = {
8 bindsTo = ["home-${userName}.mount"];
9 after = ["home-${userName}.mount"];
10 };
11
12 systemd.mounts = [
13 {
14 where = "/home/${userName}";
15 wants = ["home-manager-${userName}.service"];
16 }
17 ];
18
19 home-manager.users.${userName} = { 7 home-manager.users.${userName} = {
20 nixpkgs.config = { 8 nixpkgs.config = {
21 allowUnfree = true; 9 allowUnfree = true;
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}