irs/default.nix

48 lines
862 B
Nix
Raw Permalink 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
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";
version = "0.3";
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
'';
2024-05-14 15:40:21 +02:00
preConfig = ''
patchShebangs ./bin/*
'';
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" \
2024-05-14 15:40:21 +02:00
--replace "xdotool" "${xdotool}/bin/xdotool"
2023-11-30 16:24:19 +01:00
'';
}