nix-config/hosts/common/global/user.nix

46 lines
891 B
Nix

{
inputs,
outputs,
pkgs,
config,
vars,
...
}: let
ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups;
in {
imports = builtins.attrValues outputs.nixosModules; #propagates imports downwards
users.users.${vars.user} = {
isNormalUser = true;
shell = pkgs.fish;
extraGroups =
[
"wheel"
"video"
"audio"
"camera"
]
++ ifTheyExist [
"minecraft"
"network"
"networkmanager"
"wireshark"
"i2c"
"mysql"
"docker"
"podman"
"git"
"libvirtd"
"deluge"
"lp"
"scanner"
"kvm"
"libvirtd"
"tty"
"dialout"
];
packages = [pkgs.home-manager];
};
home-manager.users.${vars.user} = import ../../../home/${config.networking.hostName}.nix;
}