Files
sp-config/users.nix

29 lines
673 B
Nix
Raw Normal View History

{ config, ... }:
2021-11-15 13:29:20 +03:00
let
cfg = config.selfprivacy;
2021-11-15 13:29:20 +03:00
in
2021-11-15 13:02:05 +03:00
{
users = {
mutableUsers = false;
allowNoPasswordLogin = true;
2025-06-18 19:53:44 +03:00
users =
{
"${cfg.username}" = {
2021-11-15 13:29:20 +03:00
isNormalUser = true;
2025-06-18 19:53:44 +03:00
hashedPassword = cfg.hashedMasterPassword;
openssh.authorizedKeys.keys = cfg.sshKeys;
2021-11-15 13:29:20 +03:00
};
2025-06-18 19:53:44 +03:00
}
// 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
);
2021-11-15 13:02:05 +03:00
};
}