{ lib, config, pkgs, ... }: let cfg = config.desktopUser; in { options.desktopUser = { enable = lib.mkEnableOption "Enable desktop user module"; userName = lib.mkOption { default = "pazpi"; type = lib.types.str; description = config.users.users."".userName.description; }; description = lib.mkOption { default = "Davide Pasetto"; type = lib.types.str; description = config.users.users."".description; }; hashedPassword = lib.mkOption { default = ""; type = lib.types.str; description = config.users.users."".initialHashedPassword.description; }; flatpak = lib.mkOption { default = false; type = lib.types.bool; description = '' Enable the flatpak engine for the user ''; }; }; config = lib.mkIf cfg.enable { users.users.${cfg.userName} = { description = cfg.description; extraGroups = [ "users" "wheel" ]; initialHashedPassword = cfg.hashedPassword; isNormalUser = true; isSystemUser = false; shell = pkgs.zsh; uid = 1000; packages = with pkgs; lib.mkIf cfg.flatpak [ flatpak ]; }; console.keyMap = "it"; programs.zsh.enable = true; }; }