2024-02-18 15:24:18 +00:00
|
|
|
{ rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, lib
|
|
|
|
|
|
|
|
, installShellFiles
|
|
|
|
, stdenv
|
|
|
|
, Foundation
|
2024-04-22 12:42:13 +00:00
|
|
|
, rust-jemalloc-sys
|
2024-02-18 15:24:18 +00:00
|
|
|
|
|
|
|
, nix-update-script
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "yazi";
|
2024-04-23 21:07:44 +00:00
|
|
|
version = "0.2.5";
|
2024-02-18 15:24:18 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sxyazi";
|
2024-04-02 21:44:09 +00:00
|
|
|
repo = "yazi";
|
2024-02-18 15:24:18 +00:00
|
|
|
rev = "v${version}";
|
2024-04-23 21:07:44 +00:00
|
|
|
hash = "sha256-RwkgJX4naD3t97ce4Zg/VWJ41QiVFFqDW5nHpyMtISY=";
|
2024-02-18 15:24:18 +00:00
|
|
|
};
|
|
|
|
|
2024-04-23 21:07:44 +00:00
|
|
|
cargoHash = "sha256-qnbinuTuaPiD7ib3aCJzSwuA4s3naFzi+txqX7jkHIo=";
|
2024-02-18 15:24:18 +00:00
|
|
|
|
|
|
|
env.YAZI_GEN_COMPLETIONS = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
2024-04-23 11:23:19 +00:00
|
|
|
buildInputs = [ rust-jemalloc-sys ] ++ lib.optionals stdenv.isDarwin [ Foundation ];
|
2024-02-18 15:24:18 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion --cmd yazi \
|
2024-03-09 14:29:07 +00:00
|
|
|
--bash ./yazi-boot/completions/yazi.bash \
|
|
|
|
--fish ./yazi-boot/completions/yazi.fish \
|
|
|
|
--zsh ./yazi-boot/completions/_yazi
|
2024-04-02 21:44:33 +00:00
|
|
|
|
|
|
|
install -Dm444 assets/yazi.desktop -t $out/share/applications
|
|
|
|
install -Dm444 assets/logo.png $out/share/pixmaps/yazi.png
|
2024-02-18 15:24:18 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
|
2024-04-02 21:44:23 +00:00
|
|
|
meta = {
|
2024-02-18 15:24:18 +00:00
|
|
|
description = "Blazing fast terminal file manager written in Rust, based on async I/O";
|
|
|
|
homepage = "https://github.com/sxyazi/yazi";
|
2024-04-02 21:44:23 +00:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ xyenon matthiasbeyer ];
|
2024-02-18 15:24:18 +00:00
|
|
|
mainProgram = "yazi";
|
|
|
|
};
|
|
|
|
}
|