From 85a99937a1c2f6f1d4827adaddca6b77bc526f8b Mon Sep 17 00:00:00 2001 From: Matthieu Coudron <886074+teto@users.noreply.github.com> Date: Tue, 9 Dec 2025 15:33:28 +0100 Subject: [PATCH] feat: install manpages from flake (#3417) --- Cargo.lock | 4 ++-- nix/yazi-unwrapped.nix | 19 ++++++++++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 77c36bf9..d29fac16 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5272,9 +5272,9 @@ dependencies = [ [[package]] name = "zune-jpeg" -version = "0.5.6" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f520eebad972262a1dde0ec455bce4f8b298b1e5154513de58c114c4c54303e8" +checksum = "dc6fb7703e32e9a07fb3f757360338b3a567a5054f21b5f52a666752e333d58e" dependencies = [ "zune-core", ] diff --git a/nix/yazi-unwrapped.nix b/nix/yazi-unwrapped.nix index eb4d0cdf..3601b485 100644 --- a/nix/yazi-unwrapped.nix +++ b/nix/yazi-unwrapped.nix @@ -6,7 +6,7 @@ lib, installShellFiles, - stdenv, + fetchFromGitHub, rust-jemalloc-sys, imagemagick, @@ -22,7 +22,7 @@ let ]; }; in -rustPlatform.buildRustPackage rec { +rustPlatform.buildRustPackage (finalAttrs: { pname = "yazi"; inherit version src; @@ -60,14 +60,27 @@ rustPlatform.buildRustPackage rec { magick assets/logo.png -resize "$RES"x"$RES" $out/share/icons/hicolor/"$RES"x"$RES"/apps/yazi.png done + installManPage ${finalAttrs.passthru.srcs.man_src}/yazi{.1,-config.5} + mkdir -p $out/share/applications install -m644 assets/yazi.desktop $out/share/applications/ ''; + passthru.srcs = { + man_src = fetchFromGitHub { + name = "manpages"; # needed to ensure name is unique + owner = "yazi-rs"; + repo = "manpages"; + rev = "8950e968f4a1ad0b83d5836ec54a070855068dbf"; + hash = "sha256-kEVXejDg4ChFoMNBvKlwdFEyUuTcY2VuK9j0PdafKus="; + }; + }; + + meta = { description = "Blazing fast terminal file manager written in Rust, based on async I/O"; homepage = "https://github.com/sxyazi/yazi"; license = lib.licenses.mit; mainProgram = "yazi"; }; -} +})