mirror of
https://git.sr.ht/~neverness/ultima
synced 2025-01-06 11:43:53 +00:00
53 lines
969 B
Nix
53 lines
969 B
Nix
{ pkgs, lib, config, userName, True, ... }:
|
|
|
|
with lib;
|
|
|
|
let cfg = config.module.misc.users;
|
|
in {
|
|
options = {
|
|
module.misc.users = {
|
|
enable = mkEnableOption "";
|
|
shell = mkOption {
|
|
default = null;
|
|
type = types.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";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|
|
|