puter/common/users.nix
2024-12-30 22:52:20 +01:00

30 lines
631 B
Nix

{
config,
lib,
...
}: let
inherit (config.users) mainUser;
in {
age.secrets = lib.mkSecrets {"user-${mainUser}" = {};};
users = {
mutableUsers = false;
mainUser = "lukas";
users = {
root = {
hashedPassword = "!";
openssh.authorizedKeys.keys = builtins.attrValues config.pubkeys.hosts;
};
${mainUser} = {
description = "Lukas Wurzinger";
uid = 1000;
isNormalUser = true;
hashedPasswordFile = config.age.secrets."user-${mainUser}".path;
openssh.authorizedKeys.keys = builtins.attrValues config.pubkeys.users;
};
};
};
}