stockholm/tv/5pkgs/simple/fzmenu/default.nix
2023-03-22 18:04:21 +01:00

51 lines
1.1 KiB
Nix

{ lib, pkgs, stdenv }:
let
terminal = pkgs.writeDashBin "terminal" ''
# usage: terminal COMMAND [ARGS...]
exec ${pkgs.alacritty-tv}/bin/alacritty \
--profile=fzmenu \
--class AlacrittyFzmenuFloat \
-e "$@"
'';
in
pkgs.runCommand "fzmenu" {
} /* sh */ ''
mkdir $out
cp -r ${./bin} $out/bin
substituteInPlace $out/bin/otpmenu \
--replace '#! /bin/sh' '#! ${pkgs.dash}/bin/dash' \
--replace '#PATH=' PATH=${lib.makeBinPath [
pkgs.coreutils
pkgs.dash
pkgs.findutils
pkgs.fzf
pkgs.gawk
(pkgs.pass.withExtensions (ext: [
ext.pass-otp
]))
pkgs.utillinux
pkgs.xdotool
terminal
]}
substituteInPlace $out/bin/passmenu \
--replace '#! /bin/sh' '#! ${pkgs.dash}/bin/dash' \
--replace '#PATH=' PATH=${lib.makeBinPath [
pkgs.coreutils
pkgs.dash
pkgs.findutils
pkgs.fzf
pkgs.gawk
(pkgs.pass.withExtensions (ext: [
ext.pass-otp
]))
pkgs.utillinux
pkgs.xdotool
terminal
]}
''