summaryrefslogtreecommitdiff
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
parent79004a0077ad0d584859e39bf7ec881e4ae67999 (diff)
downloadnixos-7a63e7adc4f929d958cd6bb1d784b640a4af6eba.tar
nixos-7a63e7adc4f929d958cd6bb1d784b640a4af6eba.tar.gz
nixos-7a63e7adc4f929d958cd6bb1d784b640a4af6eba.tar.bz2
nixos-7a63e7adc4f929d958cd6bb1d784b640a4af6eba.tar.xz
nixos-7a63e7adc4f929d958cd6bb1d784b640a4af6eba.zip
home-manager late activation
-rw-r--r--accounts/gkleen@eostre.nix2
-rw-r--r--accounts/gkleen@installer.nix8
-rw-r--r--accounts/gkleen@sif/default.nix2
-rw-r--r--accounts/gkleen@surtr.nix4
-rw-r--r--accounts/gkleen@vidhar.nix2
-rw-r--r--accounts/mherold@eostre.nix2
-rw-r--r--accounts/mherold@surtr.nix2
-rw-r--r--accounts/mherold@vidhar.nix5
-rw-r--r--accounts/mkleen@surtr.nix4
-rw-r--r--accounts/mwagner@surtr.nix4
-rw-r--r--accounts/root@eostre.nix7
-rw-r--r--accounts/root@installer.nix7
-rw-r--r--accounts/root@sif.nix2
-rw-r--r--accounts/root@surtr.nix3
-rw-r--r--accounts/root@vidhar.nix2
-rw-r--r--accounts/some@surtr.nix4
-rw-r--r--accounts/tkleen@surtr.nix4
-rw-r--r--accounts/vkleen@surtr.nix4
-rw-r--r--flake.lock12
-rw-r--r--flake.nix7
-rw-r--r--hosts/eostre/default.nix39
-rw-r--r--user-profiles/core.nix9
22 files changed, 78 insertions, 57 deletions
diff --git a/accounts/gkleen@eostre.nix b/accounts/gkleen@eostre.nix
index e8423976..e97fdab5 100644
--- a/accounts/gkleen@eostre.nix
+++ b/accounts/gkleen@eostre.nix
@@ -6,6 +6,8 @@
6 6
7 config = { 7 config = {
8 home-manager.users.${userName} = { 8 home-manager.users.${userName} = {
9 home.stateVersion = "20.09";
10
9 nixpkgs.config = { 11 nixpkgs.config = {
10 allowUnfree = true; 12 allowUnfree = true;
11 }; 13 };
diff --git a/accounts/gkleen@installer.nix b/accounts/gkleen@installer.nix
index 64629674..c7a418f8 100644
--- a/accounts/gkleen@installer.nix
+++ b/accounts/gkleen@installer.nix
@@ -1 +1,7 @@
1{...}: {} 1{ userName, ... }:
2
3{
4 home-manager.users.${userName} = { config, ... } : {
5 home.stateVersion = config.home.version.release;
6 };
7}
diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix
index de315ede..6df87347 100644
--- a/accounts/gkleen@sif/default.nix
+++ b/accounts/gkleen@sif/default.nix
@@ -64,6 +64,8 @@ in {
64 }; 64 };
65 65
66 home-manager.users.${userName} = { 66 home-manager.users.${userName} = {
67 home.stateVersion = "20.09";
68
67 nixpkgs.config = { 69 nixpkgs.config = {
68 allowUnfree = true; 70 allowUnfree = true;
69 zathura.useMupdf = false; 71 zathura.useMupdf = false;
diff --git a/accounts/gkleen@surtr.nix b/accounts/gkleen@surtr.nix
index 64629674..58c4f21d 100644
--- a/accounts/gkleen@surtr.nix
+++ b/accounts/gkleen@surtr.nix
@@ -1 +1,3 @@
1{...}: {} 1{ userName, ... }: {
2 home-manager.users.${userName}.home.stateVersion = "20.09";
3}
diff --git a/accounts/gkleen@vidhar.nix b/accounts/gkleen@vidhar.nix
index 52a32d8a..ced75a2c 100644
--- a/accounts/gkleen@vidhar.nix
+++ b/accounts/gkleen@vidhar.nix
@@ -8,6 +8,8 @@
8 }; 8 };
9 9
10 home-manager.users.${userName} = { 10 home-manager.users.${userName} = {
11 home.stateVersion = "20.09";
12
11 programs.ssh.matchBlocks = { 13 programs.ssh.matchBlocks = {
12 "git.ymir" = 14 "git.ymir" =
13 { hostname = "ymir.yggdrasil.li"; 15 { hostname = "ymir.yggdrasil.li";
diff --git a/accounts/mherold@eostre.nix b/accounts/mherold@eostre.nix
index 9eb9e738..b93cadbd 100644
--- a/accounts/mherold@eostre.nix
+++ b/accounts/mherold@eostre.nix
@@ -5,6 +5,8 @@
5 }; 5 };
6 6
7 home-manager.users.${userName} = { 7 home-manager.users.${userName} = {
8 home.stateVersion = "20.09";
9
8 nixpkgs.config = { 10 nixpkgs.config = {
9 allowUnfree = true; 11 allowUnfree = true;
10 }; 12 };
diff --git a/accounts/mherold@surtr.nix b/accounts/mherold@surtr.nix
index ba41d65f..7805eefb 100644
--- a/accounts/mherold@surtr.nix
+++ b/accounts/mherold@surtr.nix
@@ -1,6 +1,8 @@
1{ userName, ... }: 1{ userName, ... }:
2{ 2{
3 users.users.${userName} = { 3 users.users.${userName} = {
4 home.stateVersion = "20.09";
5
4 extraGroups = ["webdav"]; 6 extraGroups = ["webdav"];
5 }; 7 };
6} 8}
diff --git a/accounts/mherold@vidhar.nix b/accounts/mherold@vidhar.nix
index 7b25cc12..0fab263e 100644
--- a/accounts/mherold@vidhar.nix
+++ b/accounts/mherold@vidhar.nix
@@ -1,3 +1,6 @@
1{ userName, ... }: { 1{ userName, ... }: {
2 config.users.users.${userName}.uid = 1001; 2 config = {
3 users.users.${userName}.uid = 1001;
4 home-manager.users.${userName}.home.stateVersion = "20.09";
5 };
3} 6}
diff --git a/accounts/mkleen@surtr.nix b/accounts/mkleen@surtr.nix
index 64629674..58c4f21d 100644
--- a/accounts/mkleen@surtr.nix
+++ b/accounts/mkleen@surtr.nix
@@ -1 +1,3 @@
1{...}: {} 1{ userName, ... }: {
2 home-manager.users.${userName}.home.stateVersion = "20.09";
3}
diff --git a/accounts/mwagner@surtr.nix b/accounts/mwagner@surtr.nix
index 64629674..58c4f21d 100644
--- a/accounts/mwagner@surtr.nix
+++ b/accounts/mwagner@surtr.nix
@@ -1 +1,3 @@
1{...}: {} 1{ userName, ... }: {
2 home-manager.users.${userName}.home.stateVersion = "20.09";
3}
diff --git a/accounts/root@eostre.nix b/accounts/root@eostre.nix
new file mode 100644
index 00000000..c7a418f8
--- /dev/null
+++ b/accounts/root@eostre.nix
@@ -0,0 +1,7 @@
1{ userName, ... }:
2
3{
4 home-manager.users.${userName} = { config, ... } : {
5 home.stateVersion = config.home.version.release;
6 };
7}
diff --git a/accounts/root@installer.nix b/accounts/root@installer.nix
new file mode 100644
index 00000000..c7a418f8
--- /dev/null
+++ b/accounts/root@installer.nix
@@ -0,0 +1,7 @@
1{ userName, ... }:
2
3{
4 home-manager.users.${userName} = { config, ... } : {
5 home.stateVersion = config.home.version.release;
6 };
7}
diff --git a/accounts/root@sif.nix b/accounts/root@sif.nix
index 979463ba..c9e129a0 100644
--- a/accounts/root@sif.nix
+++ b/accounts/root@sif.nix
@@ -1,6 +1,8 @@
1{ userName, ... }: 1{ userName, ... }:
2{ 2{
3 home-manager.users.${userName} = { 3 home-manager.users.${userName} = {
4 home.stateVersion = "20.09";
5
4 programs.ssh.matchBlocks = { 6 programs.ssh.matchBlocks = {
5 "git.yggdrasil.li" = { 7 "git.yggdrasil.li" = {
6 user = "gitolite"; 8 user = "gitolite";
diff --git a/accounts/root@surtr.nix b/accounts/root@surtr.nix
new file mode 100644
index 00000000..58c4f21d
--- /dev/null
+++ b/accounts/root@surtr.nix
@@ -0,0 +1,3 @@
1{ userName, ... }: {
2 home-manager.users.${userName}.home.stateVersion = "20.09";
3}
diff --git a/accounts/root@vidhar.nix b/accounts/root@vidhar.nix
index 0b5fb6ec..e82414a8 100644
--- a/accounts/root@vidhar.nix
+++ b/accounts/root@vidhar.nix
@@ -1,6 +1,8 @@
1{ config, userName, ... }: 1{ config, userName, ... }:
2{ 2{
3 home-manager.users.${userName} = { 3 home-manager.users.${userName} = {
4 home.stateVersion = "20.09";
5
4 programs.ssh.matchBlocks = { 6 programs.ssh.matchBlocks = {
5 "yggdrasil.borgbase" = 7 "yggdrasil.borgbase" =
6 { hostname = "nx69hpl8.repo.borgbase.com"; 8 { hostname = "nx69hpl8.repo.borgbase.com";
diff --git a/accounts/some@surtr.nix b/accounts/some@surtr.nix
index 64629674..58c4f21d 100644
--- a/accounts/some@surtr.nix
+++ b/accounts/some@surtr.nix
@@ -1 +1,3 @@
1{...}: {} 1{ userName, ... }: {
2 home-manager.users.${userName}.home.stateVersion = "20.09";
3}
diff --git a/accounts/tkleen@surtr.nix b/accounts/tkleen@surtr.nix
index 64629674..58c4f21d 100644
--- a/accounts/tkleen@surtr.nix
+++ b/accounts/tkleen@surtr.nix
@@ -1 +1,3 @@
1{...}: {} 1{ userName, ... }: {
2 home-manager.users.${userName}.home.stateVersion = "20.09";
3}
diff --git a/accounts/vkleen@surtr.nix b/accounts/vkleen@surtr.nix
index 64629674..58c4f21d 100644
--- a/accounts/vkleen@surtr.nix
+++ b/accounts/vkleen@surtr.nix
@@ -1 +1,3 @@
1{...}: {} 1{ userName, ... }: {
2 home-manager.users.${userName}.home.stateVersion = "20.09";
3}
diff --git a/flake.lock b/flake.lock
index e390cec0..48705cb0 100644
--- a/flake.lock
+++ b/flake.lock
@@ -80,17 +80,17 @@
80 "utils": "utils_2" 80 "utils": "utils_2"
81 }, 81 },
82 "locked": { 82 "locked": {
83 "lastModified": 1673343300, 83 "lastModified": 1672858401,
84 "narHash": "sha256-5Xdj6kpXYMie0MlnGwqK5FaMdsedxvyuakWtyKB3zaQ=", 84 "narHash": "sha256-0Dd6c95/n6MVdqaHnIItK+d9UMJlYlPX2eMUHTsr/kc=",
85 "owner": "nix-community", 85 "owner": "pasqui23",
86 "repo": "home-manager", 86 "repo": "home-manager",
87 "rev": "176e455371a8371586e8a3ff0d56ee9f3ca2324e", 87 "rev": "3d0d3a2bc3b8f279dec0355e3fcc24001e9fb085",
88 "type": "github" 88 "type": "github"
89 }, 89 },
90 "original": { 90 "original": {
91 "owner": "nix-community", 91 "owner": "pasqui23",
92 "ref": "master",
93 "repo": "home-manager", 92 "repo": "home-manager",
93 "rev": "3d0d3a2bc3b8f279dec0355e3fcc24001e9fb085",
94 "type": "github" 94 "type": "github"
95 } 95 }
96 }, 96 },
diff --git a/flake.nix b/flake.nix
index d098f4b1..20cf2942 100644
--- a/flake.nix
+++ b/flake.nix
@@ -16,9 +16,12 @@
16 }; 16 };
17 home-manager = { 17 home-manager = {
18 type = "github"; 18 type = "github";
19 owner = "nix-community"; 19 # owner = "nix-community";
20 # repo = "home-manager";
21 # ref = "master";
22 owner = "pasqui23";
20 repo = "home-manager"; 23 repo = "home-manager";
21 ref = "master"; 24 rev = "3d0d3a2bc3b8f279dec0355e3fcc24001e9fb085";
22 inputs = { 25 inputs = {
23 nixpkgs.follows = "nixpkgs"; 26 nixpkgs.follows = "nixpkgs";
24 }; 27 };
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}
diff --git a/user-profiles/core.nix b/user-profiles/core.nix
index 29891d12..acd61b9a 100644
--- a/user-profiles/core.nix
+++ b/user-profiles/core.nix
@@ -1,15 +1,20 @@
1{ flake, userName, config, lib, utils, ... }: 1{ flake, userName, config, lib, utils, ... }:
2{ 2
3with lib;
4
5{
3 config = { 6 config = {
4 users.users.${userName} = {}; # Just make sure the user is created 7 users.users.${userName} = {}; # Just make sure the user is created
5 8
9 home-manager.useUserService = true;
6 home-manager.users.${userName} = { 10 home-manager.users.${userName} = {
7 imports = lib.attrValues flake.homeModules; 11 imports = lib.attrValues flake.homeModules;
8 12
9 config = { 13 config = {
10 manual.manpages.enable = true; 14 manual.manpages.enable = true;
11 home.stateVersion = "20.09";
12 systemd.user.startServices = "sd-switch"; 15 systemd.user.startServices = "sd-switch";
16
17 programs.ssh.internallyManaged = mkForce true;
13 }; 18 };
14 }; 19 };
15 20