{ config, pkgs, lib, user, ... }: let zshConfigDir = "${config.home-manager.users.${user.username}.xdg.configHome}/zsh"; in { home-manager.users.${user.username} = { programs.zsh = { enable = true; enableCompletion = true; autosuggestion.enable = true; syntaxHighlighting.enable = true; oh-my-zsh = { enable = true; theme = "agnoster"; plugins = [ "git" "zsh-autosuggestions" "zsh-syntax-highlighting" "docker" "kubectl" "history" "command-not-found" "extract" ]; }; shellAliases = { ls = "exa --icons -a --group-directories-first"; ll = "exa --icons -la --group-directories-first"; }; }; # Consolidated .zshrc xdg.configFile."zsh/.zshrc".text = lib.concatStringsSep "\n" [ "# Oh-My-Zsh" "export ZSH=\"${zshConfigDir}\"" "source \"${pkgs.zsh}/share/zsh/functions/Newuser/zsh-newuser-install\"" "source \"${zshConfigDir}/oh-my-zsh.sh\"" "" "# Zsh options" "setopt AUTO_CD" "setopt CORRECT" "setopt INTERACTIVE_COMMENTS" "" "# Starship" "eval \"$(starship init zsh)\"" "" "# fzf" "source \"${pkgs.fzf}/shell/key-bindings.zsh\"" "source \"${pkgs.fzf}/shell/completion.zsh\"" "" "# User customizations" "source \"${zshConfigDir}/custom.zsh\" 2>/dev/null" ]; # User customizations xdg.configFile."zsh/custom.zsh".text = '' export EDITOR="nvim" export PATH="$HOME/.local/bin:$PATH" ''; }; }