about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorMario Rodas <marsam@users.noreply.github.com>2024-04-07 14:42:45 -0500
committerGitHub <noreply@github.com>2024-04-07 14:42:45 -0500
commit5d58ded83307531ebf575189c76db74648f3c13e (patch)
tree7e94b686123c53027a1e02244546159e41b2c351 /nixos
parent632c6b8646f0c63113172bcab26267450fe88574 (diff)
parentde5b2ef096cc03796398f7ca627ad5f4306aa065 (diff)
Merge pull request #298692 from SebTM/auto-update/fzf
fzf: 0.47.0 -> 0.48.1
Diffstat (limited to 'nixos')
-rw-r--r--nixos/doc/manual/release-notes/rl-2305.section.md2
-rw-r--r--nixos/doc/manual/release-notes/rl-2405.section.md2
-rw-r--r--nixos/modules/programs/fzf.nix48
3 files changed, 34 insertions, 18 deletions
diff --git a/nixos/doc/manual/release-notes/rl-2305.section.md b/nixos/doc/manual/release-notes/rl-2305.section.md
index ce874a6e0b2d6..031442940b9e3 100644
--- a/nixos/doc/manual/release-notes/rl-2305.section.md
+++ b/nixos/doc/manual/release-notes/rl-2305.section.md
@@ -79,7 +79,7 @@ In addition to numerous new and updated packages, this release has the following
 
 - [frigate](https://frigate.video), an open source NVR built around real-time AI object detection. Available as [services.frigate](#opt-services.frigate.enable).
 
-- [fzf](https://github.com/junegunn/fzf), a command line fuzzyfinder. Available as [programs.fzf](#opt-programs.fzf.fuzzyCompletion).
+- [fzf](https://github.com/junegunn/fzf), a command line fuzzyfinder. Available as [programs.fzf](#opt-programs.fzf.enable).
 
 - [gemstash](https://github.com/rubygems/gemstash), a RubyGems.org cache and private gem server. Available as [services.gemstash](#opt-services.gemstash.enable).
 
diff --git a/nixos/doc/manual/release-notes/rl-2405.section.md b/nixos/doc/manual/release-notes/rl-2405.section.md
index 06c360c33bbd3..914129609e4fd 100644
--- a/nixos/doc/manual/release-notes/rl-2405.section.md
+++ b/nixos/doc/manual/release-notes/rl-2405.section.md
@@ -304,6 +304,8 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m
 
 - `xxd` has been moved from `vim` default output to its own output to reduce closure size. The canonical way to reference it across all platforms is `unixtools.xxd`.
 
+- `programs.fzf.keybindings` and `programs.fzf.fuzzyCompletion` got replaced by `programs.fzf.enabled` as shell-completion is included in the fzf-binary now there is no easy option to load completion and keybindings separately. Please consult fzf-documentation on how to configure/disable certain keybindings.
+
 - The `stalwart-mail` package has been updated to v0.5.3, which includes [breaking changes](https://github.com/stalwartlabs/mail-server/blob/v0.5.3/UPGRADING.md).
 
 - `services.zope2` has been removed as `zope2` is unmaintained and was relying on Python2.
diff --git a/nixos/modules/programs/fzf.nix b/nixos/modules/programs/fzf.nix
index 7c4f338e29b30..24fca7b332918 100644
--- a/nixos/modules/programs/fzf.nix
+++ b/nixos/modules/programs/fzf.nix
@@ -1,32 +1,46 @@
 { pkgs, config, lib, ... }:
+
 with lib;
+
 let
   cfg = config.programs.fzf;
+
 in
 {
+  imports = [
+    (lib.mkRemovedOptionModule [ "programs" "fzf" "keybindings" ] ''
+      Use "programs.fzf.enabled" instead, due to fzf upstream-change it's not possible to load shell-completion and keybindings separately.
+      If you want to change/disable certain keybindings please check the fzf-documentation.
+    '')
+    (lib.mkRemovedOptionModule [ "programs" "fzf" "fuzzyCompletion" ] ''
+      Use "programs.fzf.enabled" instead, due to fzf upstream-change it's not possible to load shell-completion and keybindings separately.
+      If you want to change/disable certain keybindings please check the fzf-documentation.
+    '')
+  ];
+
   options = {
-    programs.fzf = {
-      fuzzyCompletion = mkEnableOption (mdDoc "fuzzy completion with fzf");
-      keybindings = mkEnableOption (mdDoc "fzf keybindings");
-    };
+    programs.fzf.enable = mkEnableOption (mdDoc "fuzzy completion with fzf and keybindings");
   };
-  config = {
-    environment.systemPackages = optional (cfg.keybindings || cfg.fuzzyCompletion) pkgs.fzf;
 
-    programs.bash.interactiveShellInit = optionalString cfg.fuzzyCompletion ''
-      source ${pkgs.fzf}/share/fzf/completion.bash
-    '' + optionalString cfg.keybindings ''
-      source ${pkgs.fzf}/share/fzf/key-bindings.bash
+  config = mkIf cfg.enable {
+    environment.systemPackages = [ pkgs.fzf ];
+
+    programs.bash.interactiveShellInit = ''
+      eval "$(${getExe pkgs.fzf} --bash)"
+    '';
+
+    programs.fish.interactiveShellInit = ''
+      ${getExe pkgs.fzf} --fish | source
     '';
 
-    programs.zsh.interactiveShellInit = optionalString (!config.programs.zsh.ohMyZsh.enable)
-      (optionalString cfg.fuzzyCompletion ''
-        source ${pkgs.fzf}/share/fzf/completion.zsh
-      '' + optionalString cfg.keybindings ''
-        source ${pkgs.fzf}/share/fzf/key-bindings.zsh
-      '');
+    programs.zsh = {
+      interactiveShellInit = optionalString (!config.programs.zsh.ohMyZsh.enable) ''
+        eval "$(${getExe pkgs.fzf} --zsh)"
+      '';
 
-    programs.zsh.ohMyZsh.plugins = lib.mkIf (cfg.keybindings || cfg.fuzzyCompletion) [ "fzf" ];
+      ohMyZsh.plugins = mkIf (config.programs.zsh.ohMyZsh.enable) [ "fzf" ];
+    };
   };
+
   meta.maintainers = with maintainers; [ laalsaas ];
 }