nixos/modules/users/nero.nix
2024-08-05 23:39:24 +03:00

39 lines
839 B
Nix

{ lib, config, ... }:
let
types = lib.types;
in
{
options.maid.masters.nero = {
enable = lib.mkEnableOption "Nero user";
hashedPasswordFile = lib.mkOption {
type = types.str;
};
groups = lib.mkOption {
type = types.listOf types.str;
default = [ "wheel" "docker" "networkmanager" ];
};
uid = lib.mkOption {
type = types.int;
default = 1337;
};
authorizedKeys = lib.mkOption {
type = types.listOf lib.str;
default = [];
};
};
config = lib.mkIf config.maid.masters.nero.enable (
let
nero = config.maid.masters.nero;
in
{
users.users.nero = {
isNormalUser = true;
uid = nero.uid;
openssh.authorizedKeys.keys = nero.authorizedKeys;
hashedPasswordFile = nero.hashedPasswordFile;
};
}
);
}