40 lines
750 B
Nix
40 lines
750 B
Nix
|
{ config
|
||
|
, lib
|
||
|
, options
|
||
|
, pkgs
|
||
|
, ...
|
||
|
}:
|
||
|
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 = [
|
||
|
./authorized_keys
|
||
|
];
|
||
|
isNormalUser = true;
|
||
|
extraGroups = [ "wheel" "dialout" ] ++ cfg.extraGroups;
|
||
|
initialPassword = true;
|
||
|
} // cfg.extraOptions;
|
||
|
|
||
|
users.defaultUserShell = pkgs.fish;
|
||
|
programs.fish.enable = true;
|
||
|
};
|
||
|
}
|