wip
This commit is contained in:
parent
1231503914
commit
c15ee0a39b
30 changed files with 703 additions and 118 deletions
45
modules/user/default.nix
Normal file
45
modules/user/default.nix
Normal file
|
@ -0,0 +1,45 @@
|
|||
{
|
||||
options,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.aa.user;
|
||||
in {
|
||||
options.aa.user = with types; {
|
||||
name = mkOption {
|
||||
type = str;
|
||||
default = "alejandro";
|
||||
description = "The name to use for the user account.";
|
||||
};
|
||||
extraGroups = mkOption {
|
||||
type = listOf str;
|
||||
default = ["video" "networkmanager" "docker"];
|
||||
description = "Groups to for the user to be assigned.";
|
||||
};
|
||||
extraOptions = mkOption {
|
||||
type = attrs;
|
||||
default = {};
|
||||
description = "Extra options passed to <option>users.user.<name></option>.";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
users.users.${cfg.name} =
|
||||
{
|
||||
isNormalUser = true;
|
||||
|
||||
inherit (cfg) name;
|
||||
|
||||
home = "/home/{$cfg.name}";
|
||||
group = "users";
|
||||
|
||||
shell = pkgs.zsh;
|
||||
|
||||
extraGroups = ["wheel"] ++ cfg.extraGroups;
|
||||
}
|
||||
// cfg.extraOptions;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue