mirror of
https://git.sr.ht/~neverness/ultima
synced 2025-01-08 17:53:53 +00:00
38 lines
811 B
Nix
38 lines
811 B
Nix
{ pkgs, lib, config, userName, wm, True, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.module.misc.users;
|
|
grp = [ "video" "audio" "networkmanager" "wheel" "docker" "libvirtd" ];
|
|
in {
|
|
options = {
|
|
module.misc.users = {
|
|
enable = mkEnableOption "";
|
|
shell = mkOption {
|
|
default = null;
|
|
type = types.str;
|
|
};
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
programs.${cfg.shell} = True;
|
|
users = { # USERS SETS
|
|
defaultUserShell = pkgs.${cfg.shell};
|
|
groups.${userName} = { };
|
|
users.${userName} = {
|
|
uid = 1000;
|
|
home = "/home/${userName}";
|
|
createHome = true;
|
|
isNormalUser = true;
|
|
extraGroups = grp;
|
|
loginShellInit = ''
|
|
[ "$(tty)" = "/dev/tty1" ] && exec ${wm.sh} # LAUNCH WM
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
}
|
|
|