Something went wrong. Try again.
NixOS / Nix-darwin / Home Manager dotfiles for my devices
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106{ flake.modules.homeManager.zsh = { lib, config, pkgs, ... }: { programs.zsh = { enable = true; dotDir = "${config.home.homeDirectory}/.config/zsh"; autosuggestion = { enable = true; highlight = "fg=8,bold,underline"; }; defaultKeymap = "emacs"; initContent = let hostnamePattern = if pkgs.stdenv.hostPlatform.isDarwin then "$(scutil --get LocalHostName)" else "%m"; in '' source ${pkgs.git}/share/git/contrib/completion/git-prompt.sh function __my_zsh_set_direnv_status { if direnv status | grep -q "Loaded RC"; then __my_zsh_direnv_status=direnv elif echo "''${PATH%:*:*}" | grep -q "/nix/store"; # Change PATH%:* because Ghostty and jq-zsh will add their entries onto the path, as the last item then if [ -z "$IN_NIX_SHELL" ] then __my_zsh_direnv_status=shell else __my_zsh_direnv_status=dev fi else __my_zsh_direnv_status="" fi } function precmd_prompt { if jj root > /dev/null 2>&1 then _PROMPT_ENV=$(jj log -r 'heads((::@ | @::) & (bookmarks() | remote_bookmarks()))' -T 'self.bookmarks() ++ "\n"' -G --ignore-working-copy) else _PROMPT_ENV=$(__git_ps1 "%s") fi __my_zsh_set_direnv_status if [ ! -z "$_PROMPT_ENV" ] && [ ! -z "$__my_zsh_direnv_status" ] then _PROMPT_ENV+="|" fi _PROMPT_ENV+=$__my_zsh_direnv_status if [ ! -z "$_PROMPT_ENV" ] then _PROMPT_ENV="($_PROMPT_ENV)" fi if [ "$SHLVL" != '1' ] then _PROMPT_ENV="$_PROMPT_ENV"* fi if [ ! -z "$_PROMPT_ENV" ] then _PROMPT_ENV=" $_PROMPT_ENV" fi } add-zsh-hook precmd precmd_prompt setopt prompt_subst export PROMPT='%n@%U${hostnamePattern}%u''${_PROMPT_ENV} λ ' export RPROMPT="%F{green}%~%f"
[ -n "$EAT_SHELL_INTEGRATION_DIR" ] && \ source "$EAT_SHELL_INTEGRATION_DIR/zsh"
${lib.getExe pkgs.bible.asv} random ''; syntaxHighlighting.enable = true; plugins = with pkgs; [ { name = "jq"; src = jq-zsh-plugin; file = "share/jq-zsh-plugin/jq.plugin.zsh"; } { name = "autopair"; src = zsh-autopair; file = "share/zsh/zsh-autopair/autopair.zsh"; } { name = "zsh-llm-assist"; src = fetchFromGitHub { owner = "championswimmer"; repo = "zsh-llm-assist"; rev = "13ec3e94a63a0787de1306ca2ac0a315ce3d80ce"; hash = "sha256-bFUeZAmV4KOaxNfBko7PPaVs2nR/n5sPmuFopWMamr0="; }; file = "zsh-llm-assist.plugin.zsh"; } ]; sessionVariables = { ZSH_LLM_CLI_TOOL = "pi"; }; }; };}