1
0
Fork 0
mirror of https://git.sr.ht/~neverness/ultima synced 2025-01-10 03:53:53 +00:00
ultima/modules/nixos/misc/users/default.nix
2024-12-09 10:15:55 +09:00

50 lines
909 B
Nix

{ x, pkgs, lib, config, userName, True, ... }:
with lib;
with x;
let cfg = config.module.misc.users;
in {
options = {
module.misc.users = {
enable = mkBool;
shell = mkOpt.str;
};
};
config = mkIf cfg.enable {
programs.${cfg.shell} = True;
users = let
grp = [
"video"
"audio"
"networkmanager"
"wheel"
"docker"
"libvirtd"
"terraria"
"transmission"
];
in { # USERS SETS
defaultUserShell = pkgs.${cfg.shell};
groups = {
${userName} = { };
tpws = { };
};
users = {
${userName} = {
uid = 1000;
home = "/home/${userName}";
createHome = true;
isNormalUser = true;
extraGroups = grp;
};
tpws = {
isSystemUser = true;
group = "tpws";
};
};
};
};
}