diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2015-09-30 23:43:33 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2015-09-30 23:43:33 +0200 |
commit | ac6fc8cda6a5f947d7647a79433dc76ae83fed5b (patch) | |
tree | 1c65cf5f68d480b05f48e61d5b8f7682224dc78a | |
parent | 7fb560657077cd9ebb1788760cb6ada8f0eedf32 (diff) | |
download | nixos-ac6fc8cda6a5f947d7647a79433dc76ae83fed5b.tar nixos-ac6fc8cda6a5f947d7647a79433dc76ae83fed5b.tar.gz nixos-ac6fc8cda6a5f947d7647a79433dc76ae83fed5b.tar.bz2 nixos-ac6fc8cda6a5f947d7647a79433dc76ae83fed5b.tar.xz nixos-ac6fc8cda6a5f947d7647a79433dc76ae83fed5b.zip |
modular xmpp users config
-rw-r--r-- | users.nix | 9 | ||||
-rw-r--r-- | users/xmpp-template.nix | 7 |
2 files changed, 14 insertions, 2 deletions
@@ -1,5 +1,10 @@ | |||
1 | { | 1 | {config, ...}: |
2 | |||
3 | let | ||
4 | xmppUsers = []; | ||
5 | in { | ||
2 | users.mutableUsers = false; | 6 | users.mutableUsers = false; |
3 | users.defaultUserShell = "/run/current-system/sw/bin/zsh"; | 7 | users.defaultUserShell = "/run/current-system/sw/bin/zsh"; |
4 | users.extraUsers.gkleen = import ./users/gkleen.nix; | 8 | users.extraUsers = builtins.listToAttrs (map (name: { inherit name; value = import (builtins.toPath ("./users/" + name + ".nix")) {}; }) |
9 | ["gkleen"] ++ (if config.networking.hostname == "ymir" then xmppUsers else [])); | ||
5 | } | 10 | } |
diff --git a/users/xmpp-template.nix b/users/xmpp-template.nix new file mode 100644 index 00000000..5710aaec --- /dev/null +++ b/users/xmpp-template.nix | |||
@@ -0,0 +1,7 @@ | |||
1 | { | ||
2 | name = "flastname"; | ||
3 | description = "FirstName LastName"; | ||
4 | extraGroups = ["xmpp"]; | ||
5 | group = "users"; | ||
6 | hashedPassword = "$(pwgen | mkpasswd -m sha-512 -R 500000)"; | ||
7 | } | ||