2024-01-18 01:32:15 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
2024-03-04 22:51:04 +00:00
|
|
|
inputs,
|
2024-01-18 01:32:15 +00:00
|
|
|
...
|
2024-01-15 22:30:41 +00:00
|
|
|
}:
|
|
|
|
let
|
|
|
|
inherit (lib) types;
|
|
|
|
cfg = config.mtxyz.user;
|
|
|
|
in {
|
|
|
|
options.mtxyz.user = {
|
|
|
|
extraGroups = lib.mkOption {
|
|
|
|
type = (types.listOf types.str);
|
|
|
|
default = [ ];
|
|
|
|
};
|
|
|
|
extraOptions = lib.mkOption {
|
|
|
|
type = types.attrs;
|
|
|
|
default = { };
|
|
|
|
};
|
|
|
|
name = lib.mkOption {
|
|
|
|
type = types.str;
|
|
|
|
default = "mtxyz";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = {
|
|
|
|
users.users.${cfg.name} = {
|
|
|
|
openssh.authorizedKeys.keyFiles = [
|
2024-03-04 22:51:04 +00:00
|
|
|
"${inputs.self}/secrets/authorized_keys"
|
2024-01-15 22:30:41 +00:00
|
|
|
];
|
|
|
|
isNormalUser = true;
|
|
|
|
extraGroups = [ "wheel" "dialout" ] ++ cfg.extraGroups;
|
2024-01-18 01:32:15 +00:00
|
|
|
initialPassword = "";
|
2024-01-15 22:30:41 +00:00
|
|
|
} // cfg.extraOptions;
|
|
|
|
|
|
|
|
users.defaultUserShell = pkgs.fish;
|
|
|
|
programs.fish.enable = true;
|
|
|
|
};
|
|
|
|
}
|