2024-08-01 06:01:07 +03:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
runCommand,
|
|
|
|
makeWrapper,
|
|
|
|
yazi-unwrapped,
|
2023-09-22 11:08:17 +03:00
|
|
|
|
2024-08-01 06:01:07 +03:00
|
|
|
withFile ? true,
|
|
|
|
file,
|
|
|
|
withJq ? true,
|
|
|
|
jq,
|
|
|
|
withPoppler ? true,
|
|
|
|
poppler_utils,
|
|
|
|
withUnar ? true,
|
|
|
|
unar,
|
|
|
|
withFfmpegthumbnailer ? true,
|
|
|
|
ffmpegthumbnailer,
|
|
|
|
withFd ? true,
|
|
|
|
fd,
|
|
|
|
withRipgrep ? true,
|
|
|
|
ripgrep,
|
|
|
|
withFzf ? true,
|
|
|
|
fzf,
|
|
|
|
withZoxide ? true,
|
|
|
|
zoxide,
|
2023-09-22 11:08:17 +03:00
|
|
|
}:
|
|
|
|
|
2024-04-24 12:44:04 +03:00
|
|
|
let
|
2024-08-01 06:01:07 +03:00
|
|
|
inherit (lib) optional makeBinPath;
|
|
|
|
runtimePaths =
|
|
|
|
optional withFile file
|
2024-04-24 12:44:04 +03:00
|
|
|
++ optional withJq jq
|
|
|
|
++ optional withPoppler poppler_utils
|
|
|
|
++ optional withUnar unar
|
|
|
|
++ optional withFfmpegthumbnailer ffmpegthumbnailer
|
|
|
|
++ optional withFd fd
|
|
|
|
++ optional withRipgrep ripgrep
|
|
|
|
++ optional withFzf fzf
|
|
|
|
++ optional withZoxide zoxide;
|
|
|
|
in
|
|
|
|
runCommand yazi-unwrapped.name
|
2024-08-01 06:01:07 +03:00
|
|
|
{
|
|
|
|
inherit (yazi-unwrapped) pname version meta;
|
2024-04-24 12:44:04 +03:00
|
|
|
|
2024-08-01 06:01:07 +03:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
}
|
|
|
|
''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
ln -s ${yazi-unwrapped}/share $out/share
|
|
|
|
ln -s ${yazi-unwrapped}/bin/ya $out/bin/ya
|
|
|
|
makeWrapper ${yazi-unwrapped}/bin/yazi $out/bin/yazi \
|
|
|
|
--prefix PATH : "${makeBinPath runtimePaths}"
|
|
|
|
''
|