2023-11-16 04:00:11 +04:00
|
|
|
{ config, ... }:
|
2021-11-15 13:29:20 +03:00
|
|
|
let
|
2023-11-16 04:00:11 +04:00
|
|
|
cfg = config.selfprivacy;
|
2021-11-15 13:29:20 +03:00
|
|
|
in
|
2021-11-15 13:02:05 +03:00
|
|
|
{
|
|
|
|
users = {
|
2024-01-23 16:37:26 +04:00
|
|
|
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
|
|
|
};
|
|
|
|
}
|