config.nix/modules/user/default.nix

52 lines
917 B
Nix

{
config,
pkgs,
inputs,
lib,
...
}:
{
options = {
user = {
userName = lib.mkOption {
default = "marty";
description = ''
main user name
'';
};
email = lib.mkOption {
default = "${config.user.userName}@${config.networking.domain}";
description = "main user email";
};
shell = lib.mkOption {
default = pkgs.fish;
description = ''
main user shell
'';
};
};
};
config = {
users.users.${config.user.userName} = {
isNormalUser = true;
description = "${config.user.userName}";
extraGroups = [
"networkmanager"
"wheel"
"video"
"audio"
"render"
"docker"
"input"
];
shell = config.user.shell;
};
security.sudo = {
enable = true;
wheelNeedsPassword = true;
};
};
}