2023-11-16 00:00:11 +00:00
|
|
|
{ config, ... }:
|
2021-11-15 10:29:20 +00:00
|
|
|
let
|
2023-11-16 00:00:11 +00:00
|
|
|
cfg = config.selfprivacy;
|
2021-11-15 10:29:20 +00:00
|
|
|
in
|
2021-11-15 10:02:05 +00:00
|
|
|
{
|
|
|
|
users = {
|
2024-01-23 12:37:26 +00:00
|
|
|
mutableUsers = false;
|
|
|
|
allowNoPasswordLogin = true;
|
2021-11-15 10:02:05 +00:00
|
|
|
users = {
|
2021-11-15 10:29:20 +00:00
|
|
|
"${cfg.username}" = {
|
2021-11-15 10:02:05 +00:00
|
|
|
isNormalUser = true;
|
2021-11-15 10:29:20 +00:00
|
|
|
hashedPassword = cfg.hashedMasterPassword;
|
2021-11-22 16:53:43 +00:00
|
|
|
openssh.authorizedKeys.keys = cfg.sshKeys;
|
2021-11-15 10:02:05 +00:00
|
|
|
};
|
2021-11-15 10:29:20 +00:00
|
|
|
} // builtins.listToAttrs (builtins.map
|
|
|
|
(user: {
|
|
|
|
name = "${user.username}";
|
|
|
|
value = {
|
|
|
|
isNormalUser = true;
|
|
|
|
hashedPassword = user.hashedPassword;
|
2022-07-19 12:18:46 +00:00
|
|
|
openssh.authorizedKeys.keys = (if user ? sshKeys then user.sshKeys else [ ]);
|
2021-11-15 10:29:20 +00:00
|
|
|
};
|
|
|
|
})
|
|
|
|
cfg.users);
|
2021-11-15 10:02:05 +00:00
|
|
|
};
|
|
|
|
}
|