{ inputs, config, pkgs, lib, osConfig ? null, preferredShell ? "zsh", userEmail ? "danilo.reyes.251@proton.me", ... }: let inherit (pkgs) fd fzf; pokemon-colorscripts = lib.attrByPath [ pkgs.stdenv.hostPlatform.system "pokemon-colorscripts" ] null inputs.jawz-scripts.packages; shellType = if osConfig == null then preferredShell else osConfig.my.shell.type; stylixEnabled = if osConfig == null then false else lib.hasAttrByPath [ "my" "stylix" ] osConfig; commonInit = lib.optionalString (pokemon-colorscripts != null) '' ${pokemon-colorscripts}/bin/pokemon-colorscripts -r --no-title '' + '' export command_timeout=60 ''; commonAliases = inputs.self.lib.commonAliases // { open-gallery = '' cd /srv/pool/scrapping/JawZ/gallery-dl && xdg-open "$(${fd}/bin/fd . ./ Husbands wikifeet -tdirectory -d 1 | ${fzf}/bin/fzf -i)"''; }; in { imports = lib.optionals (osConfig != null) [ ./jawz-home.nix ] ++ lib.optionals stylixEnabled [ ./stylix-home.nix ]; home.stateVersion = "23.05"; programs = { ssh.enableDefaultConfig = false; bash = lib.mkIf (shellType == "bash") { enable = true; historyFile = "\${XDG_STATE_HOME}/bash/history"; shellAliases = commonAliases; enableVteIntegration = true; initExtra = commonInit; historyControl = [ "erasedups" "ignorespace" "ignoredups" ]; }; zsh = lib.mkIf (shellType == "zsh") { enable = true; dotDir = "${config.xdg.configHome}/zsh"; shellAliases = commonAliases; initContent = commonInit; history = { path = "\${XDG_STATE_HOME}/zsh/history"; expireDuplicatesFirst = true; ignoreSpace = true; ignoreAllDups = true; }; }; delta = { enable = true; enableGitIntegration = true; }; direnv = { enable = true; enableBashIntegration = shellType == "bash"; enableZshIntegration = shellType == "zsh"; nix-direnv.enable = true; }; git = { enable = true; settings = { pull.rebase = true; init.defaultBranch = "main"; user = { email = if osConfig == null then userEmail else osConfig.my.email; name = "Danilo Reyes"; }; }; }; }; xdg = { enable = true; userDirs = lib.mkIf pkgs.stdenv.isLinux { enable = true; createDirectories = false; desktop = "${config.home.homeDirectory}"; documents = "${config.home.homeDirectory}/Documents"; download = "${config.home.homeDirectory}/Downloads"; music = "${config.home.homeDirectory}/Music"; pictures = "${config.home.homeDirectory}/Pictures"; templates = "${config.xdg.dataHome}/Templates"; videos = "${config.home.homeDirectory}/Videos"; }; configFile.wgetrc.text = "hsts-file=\${XDG_CACHE_HOME}/wget-hsts"; }; }