1
0
Fork 0
mirror of https://git.sr.ht/~neverness/ultima synced 2025-01-08 18:13:52 +00:00
ultima/modules/nixos/misc/users/default.nix

53 lines
969 B
Nix
Raw Normal View History

2024-12-03 14:20:37 +00:00
{ pkgs, lib, config, userName, True, ... }:
2024-11-21 09:24:15 +00:00
with lib;
2024-12-03 14:20:37 +00:00
let cfg = config.module.misc.users;
2024-11-21 09:24:15 +00:00
in {
options = {
module.misc.users = {
enable = mkEnableOption "";
shell = mkOption {
default = null;
type = types.str;
};
};
};
config = mkIf cfg.enable {
programs.${cfg.shell} = True;
2024-12-03 14:20:37 +00:00
users = let
grp = [
"video"
"audio"
"networkmanager"
"wheel"
"docker"
"libvirtd"
"terraria"
"transmission"
];
in { # USERS SETS
2024-11-21 09:24:15 +00:00
defaultUserShell = pkgs.${cfg.shell};
2024-12-03 14:20:37 +00:00
groups = {
${userName} = { };
tpws = { };
};
users = {
${userName} = {
uid = 1000;
home = "/home/${userName}";
createHome = true;
isNormalUser = true;
extraGroups = grp;
};
tpws = {
isSystemUser = true;
group = "tpws";
};
2024-11-21 09:24:15 +00:00
};
};
};
}