Working on termonal stuff

This commit is contained in:
2026-03-07 23:29:39 +01:00
parent 775f591394
commit 4f8d49a48c
@@ -10,45 +10,82 @@ let
in in
{ {
home-manager.users.${user.username} = { home-manager.users.${user.username} = {
# Install and enable Zsh
programs.zsh = { programs.zsh = {
enable = true; enable = true;
enableCompletion = true; enableCompletion = true;
dotDir = zshConfigDir; dotDir = zshConfigDir;
autosuggestion.enable = true; autosuggestions.enable = true;
syntaxHighlighting.enable = true; syntaxHighlighting.enable = true;
oh-my-zsh = { oh-my-zsh = {
enable = true; enable = true;
theme = ""; theme = "agnoster"; # Popular minimal theme
plugins = [ plugins = [
"git" "git"
"sudo" "sudo"
"extract"
"colored-man-pages"
"command-not-found"
"history"
"docker" "docker"
"kubectl" "kubectl"
"zsh-autosuggestions"
"zsh-syntax-highlighting"
"history"
"command-not-found"
"extract"
"colored-man-pages"
]; ];
}; };
# Shell options (setopt)
shellAliases = {
ls = "exa --icons -a --group-directories-first";
ll = "exa --icons -la --group-directories-first";
grep = "grep --color=auto";
};
}; };
# Single source of truth for .zshrc # Consolidated .zshrc with best practices
xdg.configFile."zsh/.zshrc".text = lib.concatStringsSep "\n" [ xdg.configFile."zsh/.zshrc".text = lib.concatStringsSep "\n" [
"# Zsh options" "# Enable Powerlevel10k (if installed)"
"setopt AUTO_CD" "${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme"
"setopt CORRECT"
"setopt INTERACTIVE_COMMENTS"
""
"# Oh-My-Zsh" "# Oh-My-Zsh"
"export ZSH=\"${zshConfigDir}\"" "export ZSH=\"${zshConfigDir}\""
"source \"${pkgs.zsh}/share/zsh/functions/Newuser/zsh-newuser-install\"" "source \"${pkgs.zsh}/share/zsh/functions/Newuser/zsh-newuser-install\""
"source \"${zshConfigDir}/oh-my-zsh.sh\"" "source \"${zshConfigDir}/oh-my-zsh.sh\""
"" ""
"# Starship" "# Zsh options"
"setopt AUTO_CD"
"setopt CORRECT"
"setopt INTERACTIVE_COMMENTS"
"setopt APPEND_HISTORY"
"setopt INC_APPEND_HISTORY"
"setopt HIST_IGNORE_ALL_DUPS"
"setopt HIST_REDUCE_BLANKS"
"setopt HIST_SAVE_NO_DUPS"
"setopt HIST_VERIFY"
"setopt SHARE_HISTORY"
""
"# Starship prompt (if enabled)"
"eval \"$(starship init zsh)\"" "eval \"$(starship init zsh)\""
"" ""
"# User customizations (if any)" "# fzf key bindings and completion"
"source \"${zshConfigDir}/custom.zsh\" # Optional: for user-specific additions" "source \"${pkgs.fzf}/shell/key-bindings.zsh\""
"source \"${pkgs.fzf}/shell/completion.zsh\""
""
"# Load direnv"
"eval \"$(direnv hook zsh)\""
""
"# Load nix-direnv (if using direnv with Nix)"
"if [ -f \"${pkgs.nix-direnv}/share/nix-direnv/direnvrc\" ]; then"
" source \"${pkgs.nix-direnv}/share/nix-direnv/direnvrc\""
"fi"
""
"# User-specific customizations"
"source \"${zshConfigDir}/custom.zsh\" 2>/dev/null"
]; ];
# Optional: User customizations (managed separately)
xdg.configFile."zsh/custom.zsh".text = ''
# Add your custom aliases, functions, and exports here
export EDITOR="nvim"
export PATH="$HOME/.local/bin:$PATH"
'';
}; };
} }