mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nixos-config.git
synced 2024-11-27 05:11:30 +00:00
27 lines
631 B
Nix
27 lines
631 B
Nix
{ config, ... }:
|
|
let
|
|
cfg = config.selfprivacy;
|
|
in
|
|
{
|
|
users = {
|
|
mutableUsers = false;
|
|
allowNoPasswordLogin = true;
|
|
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);
|
|
};
|
|
}
|