Initial commit
This commit is contained in:
commit
1ceaf7acff
26 changed files with 434 additions and 0 deletions
5
modules/users/default.nix
Normal file
5
modules/users/default.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
imports = [
|
||||
./nero.nix
|
||||
];
|
||||
}
|
39
modules/users/nero.nix
Normal file
39
modules/users/nero.nix
Normal 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;
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue