summaryrefslogtreecommitdiffstats
path: root/lass/5pkgs
diff options
context:
space:
mode:
Diffstat (limited to 'lass/5pkgs')
-rw-r--r--lass/5pkgs/bruellwuerfel/default.nix26
-rw-r--r--lass/5pkgs/fzfmenu/default.nix26
2 files changed, 44 insertions, 8 deletions
diff --git a/lass/5pkgs/bruellwuerfel/default.nix b/lass/5pkgs/bruellwuerfel/default.nix
new file mode 100644
index 000000000..cb8f08fa8
--- /dev/null
+++ b/lass/5pkgs/bruellwuerfel/default.nix
@@ -0,0 +1,26 @@
+{ yarn2nix-moretea, fetchFromGitHub, nodePackages, nodejs }: let
+ #src = ~/src/bruellwuerfel;
+ src = fetchFromGitHub {
+ owner = "krebs";
+ repo = "bruellwuerfel";
+ rev = "57e20e630f732ce4e15b495ec5f9bf72a121b959";
+ sha256 = "08zwwl24sq21r497a03lqpy2x10az8frrsh6d38xm92snd1yf85b";
+ };
+
+in yarn2nix-moretea.mkYarnModules rec {
+ pname = "bruellwuerfel";
+ version = "1.0";
+ name = "${pname}-${version}";
+ packageJSON = "${src}/package.json";
+ yarnLock = "${src}/yarn.lock";
+ postBuild = ''
+ cp -r ${src}/{src,tsconfig.json} $out/
+ cd $out
+ ${nodePackages.typescript}/bin/tsc || :
+ mkdir -p $out/bin
+ echo '#!/bin/sh' > $out/bin/bruellwuerfel
+ echo "export NODE_PATH=$out/dist" >> $out/bin/bruellwuerfel
+ echo "${nodejs}/bin/node $out/dist/index.js" >> $out/bin/bruellwuerfel
+ chmod +x $out/bin/bruellwuerfel
+ '';
+}
diff --git a/lass/5pkgs/fzfmenu/default.nix b/lass/5pkgs/fzfmenu/default.nix
index bdae8ceed..64e95d233 100644
--- a/lass/5pkgs/fzfmenu/default.nix
+++ b/lass/5pkgs/fzfmenu/default.nix
@@ -32,14 +32,24 @@ pkgs.writeDashBin "fzfmenu" ''
done
INPUT=$(${pkgs.coreutils}/bin/cat)
OUTPUT="$(${pkgs.coreutils}/bin/mktemp)"
- ${pkgs.rxvt_unicode}/bin/urxvt \
- -name fzfmenu -title fzfmenu \
- -e ${pkgs.dash}/bin/dash -c \
- "echo \"$INPUT\" | ${pkgs.fzf}/bin/fzf \
- --history=/dev/null \
- --print-query \
- --prompt=\"$PROMPT\" \
- > \"$OUTPUT\"" 2>/dev/null
+ if [ -z ''${TERM+x} ]; then #check if we can print fzf in the shell
+ ${pkgs.rxvt_unicode}/bin/urxvt \
+ -name fzfmenu -title fzfmenu \
+ -e ${pkgs.dash}/bin/dash -c \
+ "echo \"$INPUT\" | ${pkgs.fzf}/bin/fzf \
+ --history=/dev/null \
+ --print-query \
+ --prompt=\"$PROMPT\" \
+ --reverse \
+ > \"$OUTPUT\"" 2>/dev/null
+ else
+ echo "$INPUT" | ${pkgs.fzf}/bin/fzf \
+ --history=/dev/null \
+ --print-query \
+ --prompt="$PROMPT" \
+ --reverse \
+ > "$OUTPUT"
+ fi
${pkgs.coreutils}/bin/tail -1 "$OUTPUT"
${pkgs.coreutils}/bin/rm "$OUTPUT"
''