summaryrefslogtreecommitdiffstats
path: root/krebs
diff options
context:
space:
mode:
Diffstat (limited to 'krebs')
-rw-r--r--krebs/5pkgs/simple/fzfmenu/default.nix32
1 files changed, 30 insertions, 2 deletions
diff --git a/krebs/5pkgs/simple/fzfmenu/default.nix b/krebs/5pkgs/simple/fzfmenu/default.nix
index 64e95d233..1ee55a5ab 100644
--- a/krebs/5pkgs/simple/fzfmenu/default.nix
+++ b/krebs/5pkgs/simple/fzfmenu/default.nix
@@ -1,4 +1,31 @@
-{ pkgs, ... }:
+with import <stockholm/lib>;
+{ pkgs, ... }@args:
+
+let
+ # config cannot be declared in the input attribute set because that would
+ # cause callPackage to inject the wrong config. Instead, get it from ...
+ # via args.
+ config = args.config or {};
+
+ cfg = eval.config;
+
+ eval = evalModules {
+ modules = singleton {
+ _file = toString ./profile.nix;
+ imports = singleton config;
+ options = {
+ appName = mkOption {
+ default = "fzfmenu";
+ type = types.label;
+ };
+ windowTitle = mkOption {
+ default = "fzfmenu";
+ type = types.str;
+ };
+ };
+ };
+ };
+in
pkgs.writeDashBin "fzfmenu" ''
set -efu
@@ -34,7 +61,8 @@ pkgs.writeDashBin "fzfmenu" ''
OUTPUT="$(${pkgs.coreutils}/bin/mktemp)"
if [ -z ''${TERM+x} ]; then #check if we can print fzf in the shell
${pkgs.rxvt_unicode}/bin/urxvt \
- -name fzfmenu -title fzfmenu \
+ -name ${cfg.appName} \
+ -title ${shell.escape cfg.windowTitle} \
-e ${pkgs.dash}/bin/dash -c \
"echo \"$INPUT\" | ${pkgs.fzf}/bin/fzf \
--history=/dev/null \