From aa019f372e603fa74469c9483481ea15623d7a7e Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 16 Jun 2020 21:38:24 +0200 Subject: fzfmenu: make --print-query configurable --- krebs/5pkgs/simple/fzfmenu/default.nix | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/krebs/5pkgs/simple/fzfmenu/default.nix b/krebs/5pkgs/simple/fzfmenu/default.nix index 04e53899..4c7784b4 100644 --- a/krebs/5pkgs/simple/fzfmenu/default.nix +++ b/krebs/5pkgs/simple/fzfmenu/default.nix @@ -14,13 +14,17 @@ let _file = toString ./profile.nix; imports = singleton config; options = { + appName = mkOption { + default = "fzfmenu"; + type = types.label; + }; defaultPrompt = mkOption { default = ">"; type = types.str; }; - appName = mkOption { - default = "fzfmenu"; - type = types.label; + printQuery = mkOption { + default = true; + type = types.bool; }; windowTitle = mkOption { default = "fzfmenu"; @@ -82,9 +86,8 @@ pkgs.writeDashBin "fzfmenu" '' ${pkgs.fzf}/bin/fzf \ --history=/dev/null \ - --print-query \ --prompt="$PROMPT" \ --reverse \ - | - ${pkgs.coreutils}/bin/tail -1 + ${optionalString cfg.printQuery "--print-query"} \ + ${optionalString cfg.printQuery "| ${pkgs.coreutils}/bin/tail -1"} '' -- cgit v1.2.3