{ lib, pkgs, ... }: let zshSourceCommon = ./zsh/common; isDarwin = pkgs.stdenv.hostPlatform.isDarwin; isLinux = pkgs.stdenv.hostPlatform.isLinux; in { # Let Home Manager install and manage itself. programs.home-manager.enable = true; programs.bat = { enable = true; }; programs.zsh = { enable = true; autocd = lib.mkDefault true; shellAliases = { cat = lib.mkDefault "bat --paging=never"; nixfix = lib.mkDefault "nix fmt ./**/*.nix"; } // ( if isDarwin then { hm-switch = lib.mkDefault "darwin-rebuild switch --flake ~/.config/nix"; } else if isLinux then { hm-switch = lib.mkDefault "home-manager switch --flake ~/.config/nix"; } else { } ); initExtra = lib.mkBefore '' for file in ${zshSourceCommon}/*.zsh; do source "$file" done # [Ctrl-RightArrow] - move forward one word bindkey '^[[1;3C' forward-word # [Ctrl-LeftArrow] - move backward one word bindkey '^[[1;3D' backward-word ''; }; programs.starship = { enable = true; enableZshIntegration = true; settings = { format = lib.concatStrings [ "$username" "$hostname" "$directory" "$character" ]; right_format = lib.concatStrings [ "$git_branch" "$git_commit" "$git_state" "$git_metrics" "$git_status" "($cmd_duration)" ]; scan_timeout = 25; add_newline = false; continuation_prompt = "[▸▹ ](dimmed white)"; follow_symlinks = false; directory = { truncate_to_repo = false; truncation_length = 20; truncation_symbol = "…/"; }; cmd_duration = { min_time = 100; show_milliseconds = true; format = "took [$duration]($style) "; style = "bold yellow"; }; character = { success_symbol = "[›](bold green)"; error_symbol = "[›](bold red)"; }; }; }; }