selfprivacy-nixos-config/users.nix
Alexander Tomokhov 80ba7d0bda PoC working SP module system
+ simple-nixos-mailserver as an SP module
2023-11-13 00:37:50 +04:00

26 lines
617 B
Nix

{ pkgs, config, ... }:
let
cfg = config.selfprivacy.userdata;
in
{
users.mutableUsers = false;
users = {
users = {
"${cfg.username}" = {
isNormalUser = true;
hashedPassword = cfg.hashedMasterPassword;
openssh.authorizedKeys.keys = cfg.sshKeys;
};
} // builtins.listToAttrs (builtins.map
(user: {
name = "${user.username}";
value = {
isNormalUser = true;
hashedPassword = user.hashedPassword;
openssh.authorizedKeys.keys = (if user ? sshKeys then user.sshKeys else [ ]);
};
})
cfg.users);
};
}