{ config, lib, pkgs, namespace, ... }: with lib; let cfg = config.${namespace}.user; in { options.${namespace}.user = with types; { email = lib.mkOption { type = str; default = "jalle008@proton.me"; description = "The email of the user."; }; extraGroups = lib.mkOption { type = (listOf str); default = [ ]; description = "Groups for the user to be assigned."; }; extraOptions = lib.mkOption { type = attrs; default = { }; description = "Extra options passed to ."; }; fullName = lib.mkOption { type = str; default = "Matt Jallen"; description = "The full name of the user."; }; name = lib.mkOption { type = str; default = "matt"; description = "The name to use for the user account."; }; }; config = { users.users.${cfg.name} = { inherit (cfg) name; extraGroups = [ "wheel" "systemd-journal" "mpd" "audio" "video" "input" "plugdev" "lp" "tss" "power" "nix" ] ++ cfg.extraGroups; group = "users"; home = "/home/${cfg.name}"; isNormalUser = true; shell = lib.mkDefault pkgs.zsh; uid = 1000; } // cfg.extraOptions; }; }