irs/default.nix

47 lines
898 B
Nix
Raw Normal View History

2023-11-30 16:24:19 +01:00
{ pkgs
, scdoc
, xclip
2024-05-14 15:40:21 +02:00
, maim
2024-07-23 11:20:44 +02:00
, pngquant
2023-11-30 16:24:19 +01:00
, stdenvNoCC
2024-05-14 15:40:21 +02:00
, nushell
, xdotool
2025-01-08 15:21:09 +01:00
, mpc-cli
2023-11-30 16:24:19 +01:00
, ...
}:
2024-07-23 11:20:44 +02:00
stdenvNoCC.mkDerivation {
2023-11-30 16:24:19 +01:00
pname = "irs";
2025-01-08 15:21:09 +01:00
version = "0.4";
2023-11-30 16:24:19 +01:00
src = ./src;
2024-07-23 11:20:44 +02:00
nativeBuildInputs = [
2023-11-30 16:24:19 +01:00
scdoc
2024-05-14 15:40:21 +02:00
nushell
2023-11-30 16:24:19 +01:00
];
buildPhase = ''
for page in $(find manpages -type f); do
scdoc < $page > $(basename $page .scd)
done
2025-01-08 15:21:09 +01:00
export dontPatchShebangs=1
2024-05-14 15:40:21 +02:00
'';
2023-11-30 16:24:19 +01:00
installPhase = ''
mkdir -p $out/{share/man/man1,bin,share/zsh/site-functions}
cp bin/* $out/bin/
cp completions/* $out/share/zsh/site-functions/
cp *.1 $out/share/man/man1/
2024-05-14 15:40:21 +02:00
runHook postInstall
'';
postInstall = ''
substituteInPlace $out/bin/* \
--replace "xclip" "${xclip}/bin/xclip" \
--replace "maim" "${maim}/bin/maim" \
2024-07-23 11:20:44 +02:00
--replace "pngquant" "${pngquant}/bin/pngquant" \
2025-01-08 15:21:09 +01:00
--replace "xdotool" "${xdotool}/bin/xdotool" \
--replace "mpc " "${mpc-cli}/bin/mpc "
2023-11-30 16:24:19 +01:00
'';
}