From 15c3d6eae6baadc1efee7c949263113061e0cb29 Mon Sep 17 00:00:00 2001 From: kossLAN Date: Mon, 21 Apr 2025 14:19:09 -0400 Subject: [PATCH] nix/wrapZsh: add ability to add extraPackages, specifically for using fzf --- nix/config.nix | 7 +++++++ nix/wrapZsh.nix | 16 +++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/nix/config.nix b/nix/config.nix index 726a7d5..6cf1fe2 100644 --- a/nix/config.nix +++ b/nix/config.nix @@ -15,6 +15,10 @@ in { # Whether or not to enable auto suggestions autoSuggestions = true; + extraPackages = with pkgs; [ + fzf + ]; + # Additional .zshrc configuration that you can add that will be appended to the .zshrc extraZshrc = '' # Stupid thing broken in NixOS module I think @@ -24,6 +28,9 @@ in { bindkey -v bindkey "^[[1;5C" forward-word bindkey "^[[1;5D" backward-word + + # Special plugin cases + source <(fzf --zsh) ''; # A list of path's to a plugin diff --git a/nix/wrapZsh.nix b/nix/wrapZsh.nix index f466afd..beebdc5 100644 --- a/nix/wrapZsh.nix +++ b/nix/wrapZsh.nix @@ -10,11 +10,11 @@ in paths = [pkgs.zsh]; buildInputs = [pkgs.makeWrapper]; postBuild = '' - # When it comes to zsh options, I'm probably missing some important ones, - # if you know of any that I should add please make an issue for me, thank you. - # The sh comment before the multiline is for syntax highlighting in neovim. - mkdir -p $out/etc/zsh - cp ${pkgs.writeText "zshrc" #sh + # When it comes to zsh options, I'm probably missing some important ones, + # if you know of any that I should add please make an issue for me, thank you. + # The sh comment before the multiline is for syntax highlighting in neovim. + mkdir -p $out/etc/zsh + cp ${pkgs.writeText "zshrc" #sh '' # Auto suggestions @@ -53,10 +53,12 @@ in fi '') conf.plugins} - ${conf.extraZshrc} + + ${conf.extraZshrc} ''} $out/etc/zsh/.zshrc wrapProgram $out/bin/zsh \ - --set ZDOTDIR "$out/etc/zsh" \ + --prefix PATH : "${lib.makeBinPath conf.extraPackages}" \ + --set ZDOTDIR "$out/etc/zsh" ''; }