diff --git a/home/users/christian/shell/default.nix b/home/users/christian/shell/default.nix index 4dc8f8dc..7fc857b3 100644 --- a/home/users/christian/shell/default.nix +++ b/home/users/christian/shell/default.nix @@ -20,7 +20,9 @@ in programs.tmux.enable = true; users.christian.shell = { direnv.enable = true; + nb.enable = true; ranger.enable = true; + zsh.enable = true; }; }; @@ -51,7 +53,6 @@ in gron htop killall - nb neofetch pandoc texlive.combined.scheme-small diff --git a/home/users/christian/shell/nb/default.nix b/home/users/christian/shell/nb/default.nix new file mode 100644 index 00000000..f0c4e35d --- /dev/null +++ b/home/users/christian/shell/nb/default.nix @@ -0,0 +1,31 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + + cfg = config.custom.users.christian.shell.nb; + +in + +{ + options = { + custom.users.christian.shell.nb = { + enable = mkEnableOption "nb"; + }; + }; + + config = mkIf cfg.enable { + home.packages = with pkgs; [ + nb + + # Optional dependencies: + bat + nmap + pandoc + ripgrep + tig + w3m + ]; + }; +} diff --git a/home/users/christian/shell/zsh/default.nix b/home/users/christian/shell/zsh/default.nix index 0a3b8bd6..eef79a7b 100644 --- a/home/users/christian/shell/zsh/default.nix +++ b/home/users/christian/shell/zsh/default.nix @@ -2,67 +2,81 @@ with lib; +let + + cfg = config.custom.users.christian.shell.zsh; + +in + { - home = { - file = { - "${config.programs.zsh.dotDir}/completions".source = ./completions; + options = { + custom.users.christian.shell.zsh = { + enable = mkEnableOption "Z shell"; }; }; - programs.zsh = { - enable = true; - enableAutosuggestions = true; - enableCompletion = true; - enableSyntaxHighlighting = true; - autocd = true; - dotDir = ".config/zsh"; - dirHashes = { - bb = "/mnt/bluecare/bluecare"; - bh = "/mnt/bluecare/home"; - bt = "/mnt/bluecare/transfer"; - d = "$HOME/Documents"; - dl = "$HOME/Downloads"; - hh = "/mnt/home/home"; - hm = "/mnt/home/music"; - hp = "/mnt/home/photo"; - ht = "/mnt/home/public"; - hv = "/mnt/home/video"; - p = "$HOME/Pictures"; - usb = "/run/media/chr"; - v = "$HOME/Videos"; + config = mkIf cfg.enable { + home = { + file = { + "${config.programs.zsh.dotDir}/completions".source = ./completions; + }; }; - history = - let - historySize = 1000000; - in - { - expireDuplicatesFirst = true; - extended = true; - ignoreDups = true; - ignoreSpace = true; - path = "$ZDOTDIR/.zsh_history"; - save = historySize; - share = true; - size = historySize; + + programs.zsh = { + enable = true; + enableAutosuggestions = true; + enableCompletion = true; + enableSyntaxHighlighting = true; + autocd = true; + dotDir = ".config/zsh"; + dirHashes = { + bb = "/mnt/bluecare/bluecare"; + bh = "/mnt/bluecare/home"; + bt = "/mnt/bluecare/transfer"; + d = "$HOME/Documents"; + dl = "$HOME/Downloads"; + hh = "/mnt/home/home"; + hm = "/mnt/home/music"; + hp = "/mnt/home/photo"; + ht = "/mnt/home/public"; + hv = "/mnt/home/video"; + p = "$HOME/Pictures"; + usb = "/run/media/chr"; + v = "$HOME/Videos"; + }; + history = + let + historySize = 1000000; + in + { + expireDuplicatesFirst = true; + extended = true; + ignoreDups = true; + ignoreSpace = true; + path = "$ZDOTDIR/.zsh_history"; + save = historySize; + share = true; + size = historySize; + }; + initExtra = '' + # Fix for https://superuser.com/questions/997593/why-does-zsh-insert-a-when-i-press-the-delete-key + bindkey "^[[3~" delete-char + # Fix for https://stackoverflow.com/questions/43249043/bind-delete-key-in-vi-mode + bindkey -a '^[[3~' vi-delete-char + ''; + initExtraBeforeCompInit = '' + fpath=(~/.zsh/completion $fpath) + ''; + shellGlobalAliases = { + "..." = "../.."; + "...." = "../../.."; + "....." = "../../../.."; + "......" = "../../../../.."; + "......." = "../../../../../.."; + "........" = "../../../../../../.."; + G = "| grep"; + UUID = "$(uuidgen | tr -d \\n)"; }; - initExtra = '' - # Fix for https://superuser.com/questions/997593/why-does-zsh-insert-a-when-i-press-the-delete-key - bindkey "^[[3~" delete-char - # Fix for https://stackoverflow.com/questions/43249043/bind-delete-key-in-vi-mode - bindkey -a '^[[3~' vi-delete-char - ''; - initExtraBeforeCompInit = '' - fpath=(~/.zsh/completion $fpath) - ''; - shellGlobalAliases = { - "..." = "../.."; - "...." = "../../.."; - "....." = "../../../.."; - "......" = "../../../../.."; - "......." = "../../../../../.."; - "........" = "../../../../../../.."; - G = "| grep"; - UUID = "$(uuidgen | tr -d \\n)"; }; }; }