diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2019-02-02 16:53:25 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2019-02-02 16:53:25 +0100 |
commit | a137d1b61a32e496995ae54d3c23a4187ed2d567 (patch) | |
tree | 4997e954dece2494a500cb1786827df6b6635d68 | |
parent | 9057cdba04ed242d00d7611574e239c810ce08f6 (diff) | |
download | nixos-a137d1b61a32e496995ae54d3c23a4187ed2d567.tar nixos-a137d1b61a32e496995ae54d3c23a4187ed2d567.tar.gz nixos-a137d1b61a32e496995ae54d3c23a4187ed2d567.tar.bz2 nixos-a137d1b61a32e496995ae54d3c23a4187ed2d567.tar.xz nixos-a137d1b61a32e496995ae54d3c23a4187ed2d567.zip |
Nicer user configuration
-rw-r--r-- | users.nix | 33 | ||||
-rw-r--r-- | users/gkleen.nix | 2 | ||||
-rw-r--r-- | users/ineumann.nix | 2 | ||||
-rw-r--r-- | users/lkellers.nix | 2 | ||||
-rw-r--r-- | users/llovisa.nix | 2 | ||||
-rw-r--r-- | users/mherold.nix | 2 | ||||
-rw-r--r-- | users/mkleen.nix | 2 | ||||
-rw-r--r-- | users/mtrinh.nix | 2 | ||||
-rw-r--r-- | users/mwagner.nix | 2 | ||||
-rw-r--r-- | users/sgoebels.nix | 2 | ||||
-rw-r--r-- | users/some.nix | 2 | ||||
-rw-r--r-- | users/sselle.nix | 2 | ||||
-rw-r--r-- | users/templates/xmpp.nix (renamed from users/xmpp-template.nix) | 1 | ||||
-rw-r--r-- | users/tkleen.nix | 2 | ||||
-rw-r--r-- | users/vkleen.nix | 2 |
15 files changed, 37 insertions, 23 deletions
@@ -1,30 +1,17 @@ | |||
1 | {config, ...}: | 1 | { config, lib, ...}: |
2 | |||
3 | with lib; | ||
2 | 4 | ||
3 | let | 5 | let |
4 | baseUsers = { | 6 | genUsersList = dirPath: concatLists (let contents = builtins.readDir dirPath; in map (name: (dirEntryToList."${contents."${name}"}" or (x: [])) "${dirPath}/${name}") (attrNames contents)); |
5 | "gkleen" = import ./users/gkleen.nix; | 7 | dirEntryToList = { |
6 | }; | 8 | "regular" = path: [(import (builtins.toPath path))]; |
7 | extraUsers = { | ||
8 | ymir = { | ||
9 | "mherold" = import ./users/mherold.nix; | ||
10 | "some" = import ./users/some.nix; | ||
11 | "llovisa" = import ./users/llovisa.nix; | ||
12 | "vkleen" = import ./users/vkleen.nix; | ||
13 | "tkleen" = import ./users/tkleen.nix; | ||
14 | "mkleen" = import ./users/mkleen.nix; | ||
15 | "lkellers" = import ./users/lkellers.nix; | ||
16 | "mwgnr" = import ./users/mwagner.nix; | ||
17 | "ineumann" = import ./users/ineumann.nix; | ||
18 | "sselle" = import ./users/sselle.nix; | ||
19 | "sgoebels" = import ./users/sgoebels.nix; | ||
20 | "mtrinh" = import ./users/mtrinh.nix; | ||
21 | }; | ||
22 | odin = { | ||
23 | "mherold" = import ./users/mherold.nix; | ||
24 | }; | ||
25 | }; | 9 | }; |
10 | |||
11 | users = genUsersList ./users; | ||
26 | host = config.networking.hostName; | 12 | host = config.networking.hostName; |
27 | in { | 13 | in { |
28 | users.mutableUsers = false; | 14 | users.mutableUsers = false; |
29 | users.extraUsers = baseUsers // (if builtins.hasAttr host extraUsers then builtins.getAttr host extraUsers else {}); | 15 | users.extraUsers = listToAttrs |
16 | (map (user: nameValuePair (user.name) (removeAttrs user ["hosts" "allHosts"])) (filter (user: elem host (user.hosts or []) || (user.allHosts or false)) users)); | ||
30 | } | 17 | } |
diff --git a/users/gkleen.nix b/users/gkleen.nix index be52116b..e8bb7295 100644 --- a/users/gkleen.nix +++ b/users/gkleen.nix | |||
@@ -12,4 +12,6 @@ | |||
12 | keys/gkleen-hel.pub | 12 | keys/gkleen-hel.pub |
13 | ]; | 13 | ]; |
14 | hashedPassword = "$6$rounds=500000$dOMgCU7DAk$yQFYGOURTEt12387LIYBnFKSWmtwXMUk1LJWnV0m7OFt.y2TnxQn2abdGA5dhwG9EmMB5wZGXf4J5F71c746C/"; | 14 | hashedPassword = "$6$rounds=500000$dOMgCU7DAk$yQFYGOURTEt12387LIYBnFKSWmtwXMUk1LJWnV0m7OFt.y2TnxQn2abdGA5dhwG9EmMB5wZGXf4J5F71c746C/"; |
15 | |||
16 | allHosts = true; | ||
15 | } | 17 | } |
diff --git a/users/ineumann.nix b/users/ineumann.nix index 30caff0e..f274baca 100644 --- a/users/ineumann.nix +++ b/users/ineumann.nix | |||
@@ -5,4 +5,6 @@ | |||
5 | group = "users"; | 5 | group = "users"; |
6 | hashedPassword = "$6$rounds=500000$ZcddLLjh9A9nT$Wdciw5g.ZHnTYcRA54LbcDePkxP.jXVgV1hRZUfCvip0noAn7AHgMimCcd570JyBzj.7clacVPsFRQZLYxWy7/"; | 6 | hashedPassword = "$6$rounds=500000$ZcddLLjh9A9nT$Wdciw5g.ZHnTYcRA54LbcDePkxP.jXVgV1hRZUfCvip0noAn7AHgMimCcd570JyBzj.7clacVPsFRQZLYxWy7/"; |
7 | isNormalUser = true; | 7 | isNormalUser = true; |
8 | |||
9 | hosts = ["ymir"]; | ||
8 | } | 10 | } |
diff --git a/users/lkellers.nix b/users/lkellers.nix index 8b211fa3..5be78d6c 100644 --- a/users/lkellers.nix +++ b/users/lkellers.nix | |||
@@ -5,4 +5,6 @@ | |||
5 | group = "users"; | 5 | group = "users"; |
6 | hashedPassword = "$6$rounds=500000$KHcqXGtdlq$ofrsiltqq8hMfNv0hp2hjhoDOI4/R//7A4vowp4SAJ0YRWEX6gfGqw.hxjhBfaQb/mitsKUnynqy7.eytTECv/"; | 6 | hashedPassword = "$6$rounds=500000$KHcqXGtdlq$ofrsiltqq8hMfNv0hp2hjhoDOI4/R//7A4vowp4SAJ0YRWEX6gfGqw.hxjhBfaQb/mitsKUnynqy7.eytTECv/"; |
7 | isNormalUser = true; | 7 | isNormalUser = true; |
8 | |||
9 | hosts = ["ymir"]; | ||
8 | } | 10 | } |
diff --git a/users/llovisa.nix b/users/llovisa.nix index ef28ee18..65a7aa4a 100644 --- a/users/llovisa.nix +++ b/users/llovisa.nix | |||
@@ -5,4 +5,6 @@ | |||
5 | group = "users"; | 5 | group = "users"; |
6 | hashedPassword = "$6$rounds=500000$LoQJQgUQT$ZrJlmnniXXNGWWYjorn6VlroOy0IE55MK2Frqy07HxC5ie4Cd7I1w5HNKZlXGY6a0PVkZ9bYv2SzNQZRUzSA2."; | 6 | hashedPassword = "$6$rounds=500000$LoQJQgUQT$ZrJlmnniXXNGWWYjorn6VlroOy0IE55MK2Frqy07HxC5ie4Cd7I1w5HNKZlXGY6a0PVkZ9bYv2SzNQZRUzSA2."; |
7 | isNormalUser = true; | 7 | isNormalUser = true; |
8 | |||
9 | hosts = ["ymir"]; | ||
8 | } | 10 | } |
diff --git a/users/mherold.nix b/users/mherold.nix index 4a35d2b9..fb99b19c 100644 --- a/users/mherold.nix +++ b/users/mherold.nix | |||
@@ -5,4 +5,6 @@ | |||
5 | group = "users"; | 5 | group = "users"; |
6 | hashedPassword = "$6$rounds=500000$y5qNae9r/U/7$HbSrmPcrPl9OQvRFMeo8PDYar32Y1i/C1R5di82rN4PPQZYxg/W.anHSI5Xws6fOQmDtvGsT0lCe4NFNxuTF41"; | 6 | hashedPassword = "$6$rounds=500000$y5qNae9r/U/7$HbSrmPcrPl9OQvRFMeo8PDYar32Y1i/C1R5di82rN4PPQZYxg/W.anHSI5Xws6fOQmDtvGsT0lCe4NFNxuTF41"; |
7 | isNormalUser = true; | 7 | isNormalUser = true; |
8 | |||
9 | hosts = ["ymir" "odin"]; | ||
8 | } | 10 | } |
diff --git a/users/mkleen.nix b/users/mkleen.nix index 7a78f0bc..e6e716a6 100644 --- a/users/mkleen.nix +++ b/users/mkleen.nix | |||
@@ -5,4 +5,6 @@ | |||
5 | group = "users"; | 5 | group = "users"; |
6 | hashedPassword = "$6$rounds=500000$bBm24zrmoktFD$kGLJA0I9q.jPgLSFej/1aqIyBo/KotXhA0pflByzF5LG/Vw9Vt0yfDvVYEHR6rTplJWYotdYaJXY3b4wnh9n.0"; | 6 | hashedPassword = "$6$rounds=500000$bBm24zrmoktFD$kGLJA0I9q.jPgLSFej/1aqIyBo/KotXhA0pflByzF5LG/Vw9Vt0yfDvVYEHR6rTplJWYotdYaJXY3b4wnh9n.0"; |
7 | isNormalUser = true; | 7 | isNormalUser = true; |
8 | |||
9 | hosts = ["ymir"]; | ||
8 | } | 10 | } |
diff --git a/users/mtrinh.nix b/users/mtrinh.nix index f5c2ab63..6d0eda51 100644 --- a/users/mtrinh.nix +++ b/users/mtrinh.nix | |||
@@ -5,4 +5,6 @@ | |||
5 | group = "users"; | 5 | group = "users"; |
6 | hashedPassword = "$6$rounds=500000$vs31Y5YPrwWe/b8$y/CclfM5NTCNq489E2YxKC7xWqPmU88CWg9lSk3XiG40RH6znl.R4Cw0n1XI8ydoABsgFWjkcm4JkCDT9Lj3L/"; | 6 | hashedPassword = "$6$rounds=500000$vs31Y5YPrwWe/b8$y/CclfM5NTCNq489E2YxKC7xWqPmU88CWg9lSk3XiG40RH6znl.R4Cw0n1XI8ydoABsgFWjkcm4JkCDT9Lj3L/"; |
7 | isNormalUser = true; | 7 | isNormalUser = true; |
8 | |||
9 | hosts = ["ymir"]; | ||
8 | } | 10 | } |
diff --git a/users/mwagner.nix b/users/mwagner.nix index 10bec079..4fac64e6 100644 --- a/users/mwagner.nix +++ b/users/mwagner.nix | |||
@@ -5,4 +5,6 @@ | |||
5 | group = "users"; | 5 | group = "users"; |
6 | hashedPassword = "$6$rounds=500000$5l71DQxKPXJ$UDUyiQur9QcmsXrV5r0gD5AWWpsJLe37bhV5NhZMjN4yh5aZjE4uqm8AXemuYTx3kKi.SWaRTglLIVvgDYf5l1"; | 6 | hashedPassword = "$6$rounds=500000$5l71DQxKPXJ$UDUyiQur9QcmsXrV5r0gD5AWWpsJLe37bhV5NhZMjN4yh5aZjE4uqm8AXemuYTx3kKi.SWaRTglLIVvgDYf5l1"; |
7 | isNormalUser = true; | 7 | isNormalUser = true; |
8 | |||
9 | hosts = ["ymir"]; | ||
8 | } | 10 | } |
diff --git a/users/sgoebels.nix b/users/sgoebels.nix index d3efcb5b..8cd93312 100644 --- a/users/sgoebels.nix +++ b/users/sgoebels.nix | |||
@@ -5,4 +5,6 @@ | |||
5 | group = "users"; | 5 | group = "users"; |
6 | hashedPassword = "$6$rounds=500000$uzD2AbY6bZAdfqt$V3oUI5YGUOwfxbs0Nd5LoXIfG1xVHimMhNkfFC5sheal8daGR60fqmwx3qdZk674oUr/GEF4ytHu6UMzIRmRa/"; | 6 | hashedPassword = "$6$rounds=500000$uzD2AbY6bZAdfqt$V3oUI5YGUOwfxbs0Nd5LoXIfG1xVHimMhNkfFC5sheal8daGR60fqmwx3qdZk674oUr/GEF4ytHu6UMzIRmRa/"; |
7 | isNormalUser = true; | 7 | isNormalUser = true; |
8 | |||
9 | hosts = ["ymir"]; | ||
8 | } | 10 | } |
diff --git a/users/some.nix b/users/some.nix index 505b3abd..4e9d9c90 100644 --- a/users/some.nix +++ b/users/some.nix | |||
@@ -5,4 +5,6 @@ | |||
5 | group = "users"; | 5 | group = "users"; |
6 | hashedPassword = "$6$rounds=500000$ZOKcPFUxFCCxbS$PSjgCpHs5GfmmusjTVEBY89NFS.hvY21.iuscfiXW8R.B2UW6ScyrIWWWPJkL4ZfI.6pKwXuf01gxazmDjy251"; | 6 | hashedPassword = "$6$rounds=500000$ZOKcPFUxFCCxbS$PSjgCpHs5GfmmusjTVEBY89NFS.hvY21.iuscfiXW8R.B2UW6ScyrIWWWPJkL4ZfI.6pKwXuf01gxazmDjy251"; |
7 | isNormalUser = true; | 7 | isNormalUser = true; |
8 | |||
9 | hosts = ["ymir"]; | ||
8 | } | 10 | } |
diff --git a/users/sselle.nix b/users/sselle.nix index 396ffa12..c290b172 100644 --- a/users/sselle.nix +++ b/users/sselle.nix | |||
@@ -5,4 +5,6 @@ | |||
5 | group = "users"; | 5 | group = "users"; |
6 | hashedPassword = "$6$rounds=50000$/H9dRtR88aUK4$Pc5QMXMALeiLCzbMm1FlH.EH9OBJsadmcvb/udp9fi3owm9B/IzdXF9Vixz8Dk2eA9urbXzpQ6FTkSrjs3pOO."; | 6 | hashedPassword = "$6$rounds=50000$/H9dRtR88aUK4$Pc5QMXMALeiLCzbMm1FlH.EH9OBJsadmcvb/udp9fi3owm9B/IzdXF9Vixz8Dk2eA9urbXzpQ6FTkSrjs3pOO."; |
7 | isNormalUser = true; | 7 | isNormalUser = true; |
8 | |||
9 | hosts = ["ymir"]; | ||
8 | } | 10 | } |
diff --git a/users/xmpp-template.nix b/users/templates/xmpp.nix index f1fdd620..c69c4e5e 100644 --- a/users/xmpp-template.nix +++ b/users/templates/xmpp.nix | |||
@@ -5,4 +5,5 @@ | |||
5 | group = "users"; | 5 | group = "users"; |
6 | hashedPassword = "$(pwgen -s 32 1 | tee /dev/stderr | mkpasswd -s -m sha-512 -R 500000)"; | 6 | hashedPassword = "$(pwgen -s 32 1 | tee /dev/stderr | mkpasswd -s -m sha-512 -R 500000)"; |
7 | isNormalUser = true; | 7 | isNormalUser = true; |
8 | hosts = ["ymir"]; | ||
8 | } | 9 | } |
diff --git a/users/tkleen.nix b/users/tkleen.nix index a36cc747..ce8eabd5 100644 --- a/users/tkleen.nix +++ b/users/tkleen.nix | |||
@@ -5,4 +5,6 @@ | |||
5 | group = "users"; | 5 | group = "users"; |
6 | hashedPassword = "$6$rounds=500000$bYwSamirigbgL6$h/VI5yxcsY25fJb9DwUdgSiSi8Re1iGwXUHaOPfVgrZDKkrkoKvDg36d/GQhlfEA9XWh58gFmW9rgVeHsse.C1"; | 6 | hashedPassword = "$6$rounds=500000$bYwSamirigbgL6$h/VI5yxcsY25fJb9DwUdgSiSi8Re1iGwXUHaOPfVgrZDKkrkoKvDg36d/GQhlfEA9XWh58gFmW9rgVeHsse.C1"; |
7 | isNormalUser = true; | 7 | isNormalUser = true; |
8 | |||
9 | hosts = ["ymir"]; | ||
8 | } | 10 | } |
diff --git a/users/vkleen.nix b/users/vkleen.nix index 5ef89d39..4fcfbee0 100644 --- a/users/vkleen.nix +++ b/users/vkleen.nix | |||
@@ -5,4 +5,6 @@ | |||
5 | group = "users"; | 5 | group = "users"; |
6 | hashedPassword = "$6$rounds=500000$wOgtkxOshMT$3wT9nRqSCZRr9MkZcDQjMM3YbAekqCxEF0TwYcmjLqUk8Z44jeWQS96H/r3SKCfKWWcIWcQNp/dAxQ/QlcKAv."; | 6 | hashedPassword = "$6$rounds=500000$wOgtkxOshMT$3wT9nRqSCZRr9MkZcDQjMM3YbAekqCxEF0TwYcmjLqUk8Z44jeWQS96H/r3SKCfKWWcIWcQNp/dAxQ/QlcKAv."; |
7 | isNormalUser = true; | 7 | isNormalUser = true; |
8 | |||
9 | hosts = ["ymir"]; | ||
8 | } | 10 | } |