{ config, lib, pkgs, namespace, ... }: let inherit (lib) types; inherit (lib.${namespace}) mkOpt; cfg = config.${namespace}.user; in { options.${namespace}.user = with types; { email = mkOpt str "evan@reichard.io" "The email of the user."; extraGroups = mkOpt (listOf str) [ ] "Groups for the user to be assigned."; extraOptions = mkOpt attrs { } "Extra options passed to ."; fullName = mkOpt str "Evan Reichard" "The full name of the user."; initialPassword = mkOpt str "password" "The initial password to use when the user is first created."; name = mkOpt str "evanreichard" "The name to use for the user account."; }; config = { users.users.${cfg.name} = { inherit (cfg) name initialPassword; extraGroups = [ "wheel" ] ++ cfg.extraGroups; group = "users"; home = "/home/${cfg.name}"; isNormalUser = true; shell = pkgs.bashInteractive; uid = 1000; } // cfg.extraOptions; }; }