Merge pull request #200752 from laalsaas/fzf

authored by Sandro and committed by GitHub 9125a8b5 e388ce5e

+61 -17
+3 -1
nixos/doc/manual/from_md/release-notes/rl-2305.section.xml
··· 25 <itemizedlist spacing="compact"> 26 <listitem> 27 <para> 28 - Create the first release note entry in this section! 29 </para> 30 </listitem> 31 </itemizedlist>
··· 25 <itemizedlist spacing="compact"> 26 <listitem> 27 <para> 28 + <link xlink:href="https://github.com/junegunn/fzf">fzf</link>, 29 + a command line fuzzyfinder. Available as 30 + <link linkend="opt-programs.fzf.fuzzyCompletion">programs.fzf</link>. 31 </para> 32 </listitem> 33 </itemizedlist>
+1 -1
nixos/doc/manual/release-notes/rl-2305.section.md
··· 14 15 <!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. --> 16 17 - - Create the first release note entry in this section! 18 19 ## Backward Incompatibilities {#sec-release-23.05-incompatibilities} 20
··· 14 15 <!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. --> 16 17 + - [fzf](https://github.com/junegunn/fzf), a command line fuzzyfinder. Available as [programs.fzf](#opt-programs.fzf.fuzzyCompletion). 18 19 ## Backward Incompatibilities {#sec-release-23.05-incompatibilities} 20
+1
nixos/modules/module-list.nix
··· 165 ./programs/flexoptix-app.nix 166 ./programs/freetds.nix 167 ./programs/fuse.nix 168 ./programs/gamemode.nix 169 ./programs/geary.nix 170 ./programs/git.nix
··· 165 ./programs/flexoptix-app.nix 166 ./programs/freetds.nix 167 ./programs/fuse.nix 168 + ./programs/fzf.nix 169 ./programs/gamemode.nix 170 ./programs/geary.nix 171 ./programs/git.nix
+37
nixos/modules/programs/fzf.nix
···
··· 1 + {pkgs, config, lib, ...}: 2 + with lib; 3 + let 4 + cfg = config.programs.fzf; 5 + in { 6 + options = { 7 + programs.fzf = { 8 + fuzzyCompletion = mkOption { 9 + type = types.bool; 10 + description = lib.mdDoc "Whether to use fzf for fuzzy completion"; 11 + default = false; 12 + example = true; 13 + }; 14 + keybindings = mkOption { 15 + type = types.bool; 16 + description = lib.mdDoc "Whether to set up fzf keybindings"; 17 + default = false; 18 + example = true; 19 + }; 20 + }; 21 + }; 22 + config = { 23 + environment.systemPackages = optional (cfg.keybindings || cfg.fuzzyCompletion) pkgs.fzf; 24 + programs.bash.interactiveShellInit = optionalString cfg.fuzzyCompletion '' 25 + source ${pkgs.fzf}/share/fzf/completion.bash 26 + '' + optionalString cfg.keybindings '' 27 + source ${pkgs.fzf}/share/fzf/key-bindings.bash 28 + ''; 29 + 30 + programs.zsh.interactiveShellInit = optionalString cfg.fuzzyCompletion '' 31 + source ${pkgs.fzf}/share/fzf/completion.zsh 32 + '' + optionalString cfg.keybindings '' 33 + source ${pkgs.fzf}/share/fzf/key-bindings.zsh 34 + ''; 35 + }; 36 + meta.maintainers = with maintainers; [ laalsaas ]; 37 + }
+19 -15
pkgs/tools/misc/fzf/default.nix
··· 1 - { lib, buildGoModule, fetchFromGitHub, writeText, runtimeShell, ncurses, perl }: 2 - 3 buildGoModule rec { 4 pname = "fzf"; 5 version = "0.35.1"; ··· 15 16 outputs = [ "out" "man" ]; 17 18 - fishHook = writeText "load-fzf-keybindings.fish" "fzf_key_bindings"; 19 20 buildInputs = [ ncurses ]; 21 ··· 38 --replace " perl -n " " ${perl}/bin/perl -n " 39 ''; 40 41 - preInstall = '' 42 - mkdir -p $out/share/fish/{vendor_functions.d,vendor_conf.d} 43 - cp shell/key-bindings.fish $out/share/fish/vendor_functions.d/fzf_key_bindings.fish 44 - cp ${fishHook} $out/share/fish/vendor_conf.d/load-fzf-key-bindings.fish 45 - ''; 46 47 - postInstall = '' 48 - cp bin/fzf-tmux $out/bin 49 50 - mkdir -p $man/share/man 51 - cp -r man/man1 $man/share/man 52 53 - mkdir -p $out/share/vim-plugins/${pname} 54 - cp -r plugin $out/share/vim-plugins/${pname} 55 56 - cp -R shell $out/share/fzf 57 cat <<SCRIPT > $out/bin/fzf-share 58 #!${runtimeShell} 59 # Run this script to find the fzf shared folder where all the shell
··· 1 + { lib 2 + , buildGoModule 3 + , fetchFromGitHub 4 + , writeText 5 + , runtimeShell 6 + , installShellFiles 7 + , ncurses 8 + , perl 9 + }: 10 buildGoModule rec { 11 pname = "fzf"; 12 version = "0.35.1"; ··· 22 23 outputs = [ "out" "man" ]; 24 25 + nativeBuildInputs = [ installShellFiles ]; 26 27 buildInputs = [ ncurses ]; 28 ··· 45 --replace " perl -n " " ${perl}/bin/perl -n " 46 ''; 47 48 + postInstall = '' 49 + install bin/fzf-tmux $out/bin 50 51 + installManPage man/man1/fzf.1 man/man1/fzf-tmux.1 52 53 + install -D plugin/* -t $out/share/vim-plugins/${pname}/plugin 54 55 + # Install shell integrations 56 + install -D shell/* -t $out/share/fzf/ 57 + install -D shell/key-bindings.fish $out/share/fish/vendor_functions.d/fzf_key_bindings.fish 58 + mkdir -p $out/share/fish/vendor_conf.d 59 + echo fzf_key_bindings > $out/share/fish/vendor_conf.d/load-fzf-key-bindings.fish 60 61 cat <<SCRIPT > $out/bin/fzf-share 62 #!${runtimeShell} 63 # Run this script to find the fzf shared folder where all the shell