From 73a07152fe850ffbf7c5897188a63047c6ea121c Mon Sep 17 00:00:00 2001 From: sajenim Date: Thu, 6 Apr 2023 09:31:23 +0800 Subject: [PATCH] add zsh.nix --- home-manager/zsh.nix | 61 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 home-manager/zsh.nix diff --git a/home-manager/zsh.nix b/home-manager/zsh.nix new file mode 100644 index 0000000..3c99d4f --- /dev/null +++ b/home-manager/zsh.nix @@ -0,0 +1,61 @@ +{ inputs, outputs, lib, config, pkgs, ... }: + +{ + home.packages = with pkgs; [ + fzf # command-line fuzzy finder + ]; + + programs.zsh = { + enable = true; + + # Enable extra features + enableAutosuggestions = true; + enableCompletion = true; + dotDir = ".config/zsh"; + + # Commands that should be added to to top of '.zshrc' + initExtraFirst = '' + ''; + + # Aliases + shellAliases = { + c = "clear"; + hm = "cd ~/"; + tp = "trash-put"; + ud = "cd .."; + la = "ls -a"; + ll = "ls -l"; + }; + + # An attribute set that adds to named directory hash table + dirHashes = { + # QMK Keymaps + km-crkbd = "$HOME/keyboards/qmk_keymaps/keyboards/crkbd/keymaps/sajenim"; + km-kchrn = "$HOME/keyboards/qmk_keymaps/keyboards/keychron/q4/ansi_v2/keymaps/sajenim"; + }; + + # Install plugins + plugins = [ + { + name = "fzf-tab"; + src = pkgs.fetchFromGitHub { + owner = "Aloxaf"; + repo = "fzf-tab"; + rev = "5a81e13792a1eed4a03d2083771ee6e5b616b9ab"; + sha256 = "dPe5CLCAuuuLGRdRCt/nNruxMrP9f/oddRxERkgm1FE="; + }; + } + ]; + + # Extra commands that should be added to '.zshrc' + initExtra = '' + # Emacs mode + bindkey -e + + # Customize prompt + PROMPT="%F{1}♥ %f%F{2}~ %f" + RPROMPT="%~" + ''; + }; +} +