From a5a10772d1a75776564a5df792c77e6bf57e4fb8 Mon Sep 17 00:00:00 2001 From: John Lancaster <32917998+jsl12@users.noreply.github.com> Date: Fri, 17 Apr 2026 00:22:45 -0500 Subject: [PATCH] reworked jsl-zsh --- modules/programs/eza.nix | 1 + modules/programs/files.nix | 2 +- modules/programs/sops.nix | 1 - modules/programs/zsh.nix | 216 +++++++++++++++---------------------- 4 files changed, 88 insertions(+), 132 deletions(-) diff --git a/modules/programs/eza.nix b/modules/programs/eza.nix index 6d6d9ab..3f5f81f 100644 --- a/modules/programs/eza.nix +++ b/modules/programs/eza.nix @@ -25,6 +25,7 @@ "--smart-group" "--no-time" "--git" + "$@" ]; }; }; diff --git a/modules/programs/files.nix b/modules/programs/files.nix index 96b7252..9a78a40 100644 --- a/modules/programs/files.nix +++ b/modules/programs/files.nix @@ -16,7 +16,7 @@ }; home.packages = with pkgs; [ - gdu + # gdu # (writeShellScriptBin "lfcd" '' # . <(${lib.getExe pkgs.lf} -print-last-dir | sed 's/^/cd /') # '') diff --git a/modules/programs/sops.nix b/modules/programs/sops.nix index 166dd61..28e8c10 100644 --- a/modules/programs/sops.nix +++ b/modules/programs/sops.nix @@ -57,7 +57,6 @@ in in { home.packages = with pkgs; [ - eza age sops # This is necessary to make the sops binary available ssh-to-age diff --git a/modules/programs/zsh.nix b/modules/programs/zsh.nix index 34461d8..3ec21c6 100644 --- a/modules/programs/zsh.nix +++ b/modules/programs/zsh.nix @@ -51,138 +51,94 @@ in }; }; - perSystem = { system, pkgs, ... }: { - packages.jsl-zsh = inputs.wrapper-modules.wrappers.zsh.wrap { - inherit pkgs; - extraPackages = with pkgs; [ - inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.neovim-min - btop - coreutils - curl - wget - yazi - zsh - ]; - }; - - packages.neovim-min = ((inputs.nvf.lib.neovimConfiguration { - inherit pkgs; - modules = [ - { - # https://nvf.notashelf.dev/search.html - config.vim = { - options = { - number = true; - relativenumber = true; - expandtab = true; - shiftwidth = 4; - tabstop = 4; - softtabstop = 4; - - wrap = true; - linebreak = true; - }; - - syntaxHighlighting = true; - - # Enable custom theming options - theme.enable = true; - theme.name = "catppuccin"; - theme.style = "mocha"; - - git.enable = true; - # git.neogit.enable = true; - extraPlugins = with pkgs.vimPlugins; { - icons = { - package = nvim-web-devicons; - }; - octo = { - package = octo-nvim; - setup = "require('octo').setup {}"; - after = ["telescope" "icons"]; - }; - }; - - # https://github.com/akinsho/toggleterm.nvim - terminal.toggleterm.enable = true; - terminal.toggleterm.lazygit.enable = true; - terminal.toggleterm.lazygit.direction = "float"; - terminal.toggleterm.lazygit.mappings.open = ""; - - utility.nix-develop.enable = true; - - filetree.neo-tree.enable = true; - - telescope = { - enable = true; - extensions = [ - { - name = "fzf"; - packages = [pkgs.vimPlugins.telescope-fzf-native-nvim]; - setup = {fzf = {fuzzy = true;};}; - } - ]; - }; - - languages = { - enableTreesitter = true; - enableFormat = true; - - markdown = { - enable = true; - extensions = { - markview-nvim.enable = true; - }; - }; - - bash.enable = true; - yaml.enable = true; - toml.enable = true; - nix.enable = true; - }; - - keymaps = [ - { - desc = "Edit key mappings"; - key = "ekm"; - mode = [ "n" ]; - silent = false; - action = ":edit +/keymaps /home/john/.config/home-manager/jsl-dendritic/modules/programs/neovim.nix"; - } - { - desc = "Home Manager Switch"; - key = "nhms"; - mode = [ "n" ]; - silent = false; - action = ":TermExec cmd='clear && nhms && exit' name='Nix Home Manager Switch' direction=float"; - } - { - desc = "Key Maps [Telescope]"; - key = "fkm"; - mode = "n"; - silent = false; - action = ":Telescope keymaps"; - } - { - desc = "Toggle Filesystem Tree [NeoTree]"; - key = ""; - mode = [ "n" "v" "t" ]; - silent = false; - action = ":Neotree toggle filesystem left action=show"; - } - { - key = ""; - mode = ["n" "v" "t"]; - silent = false; - action = ":ToggleTerm"; - } - ]; + perSystem = { config, self', pkgs, lib, ... }: { + packages.jsl-zsh = + let + ignorePatterns = [ + "ls" "eza" "history" "clear" + ]; + aliasStr = lib.concatStringsSep "\n" ( + lib.mapAttrsToList (k: v: "alias -- ${lib.escapeShellArg k}=${lib.escapeShellArg v}") { + ls = "eza"; + ll = "eza -l"; + la = "eza -a"; + lt = "eza --tree"; + lla = "eza -la"; + ds = "gdu -i /snap /"; + }); + in + (inputs.wrappers.wrapperModules.zsh.apply { + inherit pkgs; + binName = "jsl-zsh"; + settings = { + completion = { + enable = true; + extraCompletions = true; + caseInsensitive = true; + fuzzySearch = true; }; + autoSuggestions = { + enable = true; + strategy = [ "history" "completion" ]; + }; + history = { + append = true; + expanded = true; + share = true; + ignoreAllDups = true; + ignoreSpace = true; + }; + integrations = { + fzf.enable = true; + starship = { + enable = true; + package = self'.packages.starship; + }; + zoxide.enable = true; + }; + }; + extraRC = '' + HISTFILE=$HOME/.zsh_history + HISTORY_IGNORE=${lib.escapeShellArg "(${lib.concatStringsSep "|" ignorePatterns})"} + + HOSTNAME=$(hostname -s) + + ${aliasStr} + + eval "$(direnv hook zsh)" + ''; + extraPackages = with pkgs; [ + self'.packages.my-eza + self'.packages.gdu + busybox + fd + ripgrep + hostname + iproute2 + direnv + ]; + }).wrapper; + + packages.starship = (inputs.wrappers.wrapperModules.starship.apply { + inherit pkgs; + settings = lib.mkMerge [ + (lib.importTOML (pkgs.fetchurl { + url = https://starship.rs/presets/toml/catppuccin-powerline.toml; + sha256 = "0bd8zx0bpri63rnb9dva0rav75d3i2wrzw44h63m75hq5220r26g"; + })) + { + palette = "catppuccin_mocha"; + git_status.diverged = lib.mkForce "⇕⇡\${ahead_count}⇣\${behind_count}"; + cmd_duration.format = lib.mkForce "󰔛 $duration"; + python.disabled = lib.mkForce true; } ]; - }).neovim).overrideAttrs (old: { - pname = "neovim-min"; - version = "custom"; - }); + }).wrapper; + + packages.gdu = inputs.wrappers.lib.wrapPackage { + inherit pkgs; + package = pkgs.gdu; + args = [ "-x" "--si" "--collapse-path" "--mouse" "$@" ]; + }; }; } \ No newline at end of file