fzfmenu: make --print-query configurable

This commit is contained in:
tv 2020-06-16 21:38:24 +02:00
parent 3197b9a930
commit aa019f372e

View File

@ -14,13 +14,17 @@ let
_file = toString ./profile.nix; _file = toString ./profile.nix;
imports = singleton config; imports = singleton config;
options = { options = {
appName = mkOption {
default = "fzfmenu";
type = types.label;
};
defaultPrompt = mkOption { defaultPrompt = mkOption {
default = ">"; default = ">";
type = types.str; type = types.str;
}; };
appName = mkOption { printQuery = mkOption {
default = "fzfmenu"; default = true;
type = types.label; type = types.bool;
}; };
windowTitle = mkOption { windowTitle = mkOption {
default = "fzfmenu"; default = "fzfmenu";
@ -82,9 +86,8 @@ pkgs.writeDashBin "fzfmenu" ''
${pkgs.fzf}/bin/fzf \ ${pkgs.fzf}/bin/fzf \
--history=/dev/null \ --history=/dev/null \
--print-query \
--prompt="$PROMPT" \ --prompt="$PROMPT" \
--reverse \ --reverse \
| ${optionalString cfg.printQuery "--print-query"} \
${pkgs.coreutils}/bin/tail -1 ${optionalString cfg.printQuery "| ${pkgs.coreutils}/bin/tail -1"}
'' ''