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

38 lines
811 B
Nix
Raw Normal View History

2024-11-24 03:17:16 +00:00
{ pkgs, lib, config, userName, wm, True, ... }:
2024-11-21 09:24:15 +00:00
with lib;
2024-11-24 03:17:16 +00:00
let
cfg = config.module.misc.users;
grp = [ "video" "audio" "networkmanager" "wheel" "docker" "libvirtd" ];
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;
users = { # USERS SETS
defaultUserShell = pkgs.${cfg.shell};
groups.${userName} = { };
users.${userName} = {
uid = 1000;
home = "/home/${userName}";
createHome = true;
2024-11-24 03:17:16 +00:00
isNormalUser = true;
extraGroups = grp;
loginShellInit = ''
[ "$(tty)" = "/dev/tty1" ] && exec ${wm.sh} # LAUNCH WM
'';
2024-11-21 09:24:15 +00:00
};
};
};
}