Files
nix-config/modules/nixos/base/user-group.nix
Ryan Yin b143a89443 feat(ai): add webdav mount (#253)
feat(aquamarine): add group for filesharing, protect /data on subvolume mount failures
2026-03-19 22:25:48 +08:00

52 lines
1.3 KiB
Nix

{
myvars,
config,
...
}:
{
# Don't allow mutation of users outside the config.
users.mutableUsers = false;
users.groups = {
"${myvars.username}" = { };
podman = { };
docker = { };
wireshark = { };
# for android platform tools's udev rules
adbusers = { };
dialout = { };
# for openocd (embedded system development)
plugdev = { };
# misc
uinput = { };
# shared group for services that read/write the same data directory
# (e.g. sftpgo + transmission on aquamarine)
fileshare = { };
};
users.users."${myvars.username}" = {
# we have to use initialHashedPassword here when using tmpfs for /
inherit (myvars) initialHashedPassword;
home = "/home/${myvars.username}";
isNormalUser = true;
extraGroups = [
myvars.username
"users"
"wheel"
"networkmanager" # for nmtui / nm-connection-editor
"podman"
"docker"
"wireshark"
"adbusers" # android debugging
"libvirtd" # virt-viewer / qemu
"fileshare"
];
};
# root's ssh key are mainly used for remote deployment
users.users.root = {
inherit (myvars) initialHashedPassword;
openssh.authorizedKeys.keys = myvars.mainSshAuthorizedKeys ++ myvars.secondaryAuthorizedKeys;
};
}