From 80018aaa2955777edadcbed6efae5ea91a2c4776 Mon Sep 17 00:00:00 2001 From: XYenon Date: Tue, 22 Aug 2023 15:24:45 +0800 Subject: [PATCH] yazi: init at 0.1.3 --- .../file-managers/yazi/default.nix | 73 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 75 insertions(+) create mode 100644 pkgs/applications/file-managers/yazi/default.nix diff --git a/pkgs/applications/file-managers/yazi/default.nix b/pkgs/applications/file-managers/yazi/default.nix new file mode 100644 index 000000000000..ef9c47490c0b --- /dev/null +++ b/pkgs/applications/file-managers/yazi/default.nix @@ -0,0 +1,73 @@ +{ rustPlatform +, fetchFromGitHub +, lib + +, makeWrapper +, 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.3"; + + src = fetchFromGitHub { + owner = "sxyazi"; + repo = pname; + rev = "v${version}"; + hash = "sha256-IUE2846AltYyEefkavCJOEak9mW0wygojWsucwUEgh4="; + }; + + cargoHash = "sha256-wwtdaReb+teXf+VDwqAqCbSy2qWI11IRlcygmWdaqF4="; + + nativeBuildInputs = [ makeWrapper ]; + 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}" + ''; + + 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 ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8b1857254af0..f6562480c34f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -42031,4 +42031,6 @@ with pkgs; wttrbar = callPackage ../applications/misc/wttrbar { }; wpm = callPackage ../applications/misc/wpm { }; + + yazi = callPackage ../applications/file-managers/yazi { inherit (darwin.apple_sdk.frameworks) Foundation; }; }