Working on termonal stuff
This commit is contained in:
@@ -10,45 +10,82 @@ let
|
||||
in
|
||||
{
|
||||
home-manager.users.${user.username} = {
|
||||
# Install and enable Zsh
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
dotDir = zshConfigDir;
|
||||
autosuggestion.enable = true;
|
||||
autosuggestions.enable = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
oh-my-zsh = {
|
||||
enable = true;
|
||||
theme = "";
|
||||
theme = "agnoster"; # Popular minimal theme
|
||||
plugins = [
|
||||
"git"
|
||||
"sudo"
|
||||
"extract"
|
||||
"colored-man-pages"
|
||||
"command-not-found"
|
||||
"history"
|
||||
"docker"
|
||||
"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" [
|
||||
"# Zsh options"
|
||||
"setopt AUTO_CD"
|
||||
"setopt CORRECT"
|
||||
"setopt INTERACTIVE_COMMENTS"
|
||||
""
|
||||
"# Enable Powerlevel10k (if installed)"
|
||||
"${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme"
|
||||
"# Oh-My-Zsh"
|
||||
"export ZSH=\"${zshConfigDir}\""
|
||||
"source \"${pkgs.zsh}/share/zsh/functions/Newuser/zsh-newuser-install\""
|
||||
"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)\""
|
||||
""
|
||||
"# User customizations (if any)"
|
||||
"source \"${zshConfigDir}/custom.zsh\" # Optional: for user-specific additions"
|
||||
"# fzf key bindings and completion"
|
||||
"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"
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user