Initial commit

This commit is contained in:
Aleksandr 2024-08-05 20:53:43 +03:00
commit 1ceaf7acff
26 changed files with 434 additions and 0 deletions

View file

@ -0,0 +1,5 @@
{
imports = [
./nero.nix
];
}

39
modules/users/nero.nix Normal file
View file

@ -0,0 +1,39 @@
{ 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;
};
}
);
}