nixpkgs/pkgs/applications/file-managers/yazi/default.nix
Einherjar 13b98764bb
yazi: 0.1.4 -> 0.1.5 (#262500)
Co-authored-by: éclairevoyant <848000+eclairevoyant@users.noreply.github.com>
2023-10-21 21:51:17 +02:00

79 lines
1.8 KiB
Nix

{ rustPlatform
, fetchFromGitHub
, lib
, makeWrapper
, installShellFiles
, stdenv
, Foundation
, 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
, nix-update-script
}:
rustPlatform.buildRustPackage rec {
pname = "yazi";
version = "0.1.5";
src = fetchFromGitHub {
owner = "sxyazi";
repo = pname;
rev = "v${version}";
hash = "sha256-FhKrq4N32uJRHGc0qRl+CIVNRW597jACcTFEgj8hiSE=";
};
cargoHash = "sha256-YUymZhDp1Pjm+W6m8Vmh2AgMCdaNt6TQQpiJwSg/gPw=";
nativeBuildInputs = [ makeWrapper installShellFiles ];
buildInputs = lib.optionals stdenv.isDarwin [ Foundation ];
postInstall = with lib;
let
runtimePaths = [ ]
++ optional withFile file
++ 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
''
wrapProgram $out/bin/yazi \
--prefix PATH : "${makeBinPath runtimePaths}"
installShellCompletion --cmd yazi \
--bash ./config/completions/yazi.bash \
--fish ./config/completions/yazi.fish \
--zsh ./config/completions/_yazi
'';
passthru.updateScript = nix-update-script { };
meta = with lib; {
description = "Blazing fast terminal file manager written in Rust, based on async I/O";
homepage = "https://github.com/sxyazi/yazi";
license = licenses.mit;
maintainers = with maintainers; [ xyenon matthiasbeyer ];
};
}