Skip to content

Commit a773507

Browse files
committed
yazi-unwrapped: use finalAttrs
This should be better for overriding sources
1 parent fe544f3 commit a773507

File tree

1 file changed

+22
-28
lines changed

1 file changed

+22
-28
lines changed

pkgs/by-name/ya/yazi-unwrapped/package.nix

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,13 @@
88
Foundation,
99
rust-jemalloc-sys,
1010
}:
11-
let
12-
version = "25.2.26";
13-
14-
code_src = fetchFromGitHub {
15-
owner = "sxyazi";
16-
repo = "yazi";
17-
tag = "v${version}";
18-
hash = "sha256-DqhqpQRCSBTGonL9+bP7pA3mO2CemlbhwzShVdrL1/0=";
19-
};
20-
21-
man_src = fetchFromGitHub {
22-
name = "manpages"; # needed to ensure name is unique
23-
owner = "yazi-rs";
24-
repo = "manpages";
25-
rev = "8950e968f4a1ad0b83d5836ec54a070855068dbf";
26-
hash = "sha256-kEVXejDg4ChFoMNBvKlwdFEyUuTcY2VuK9j0PdafKus=";
27-
};
28-
in
29-
rustPlatform.buildRustPackage {
11+
rustPlatform.buildRustPackage (finalAttrs: {
3012
pname = "yazi";
31-
inherit version;
13+
version = "25.2.26";
3214

33-
srcs = [
34-
code_src
35-
man_src
36-
];
15+
srcs = builtins.attrValues finalAttrs.passthru.srcs;
3716

38-
sourceRoot = code_src.name;
17+
sourceRoot = finalAttrs.passthru.srcs.code_src.name;
3918

4019
useFetchCargoVendor = true;
4120
cargoHash = "sha256-xg37aypFKY0ZG9GOkygTHlOAjqkTuhLNKo8Fz6MF2ZY=";
@@ -53,14 +32,29 @@ rustPlatform.buildRustPackage {
5332
--fish ./yazi-boot/completions/yazi.fish \
5433
--zsh ./yazi-boot/completions/_yazi
5534
56-
installManPage ../${man_src.name}/yazi{.1,-config.5}
35+
installManPage ../${finalAttrs.passthru.srcs.man_src.name}/yazi{.1,-config.5}
5736
5837
install -Dm444 assets/yazi.desktop -t $out/share/applications
5938
install -Dm444 assets/logo.png $out/share/pixmaps/yazi.png
6039
'';
6140

6241
passthru.updateScript.command = [ ./update.sh ];
63-
passthru.srcs = { inherit code_src man_src; }; # for updating sources
42+
passthru.srcs = {
43+
code_src = fetchFromGitHub {
44+
owner = "sxyazi";
45+
repo = "yazi";
46+
tag = "v${finalAttrs.version}";
47+
hash = "sha256-DqhqpQRCSBTGonL9+bP7pA3mO2CemlbhwzShVdrL1/0=";
48+
};
49+
50+
man_src = fetchFromGitHub {
51+
name = "manpages"; # needed to ensure name is unique
52+
owner = "yazi-rs";
53+
repo = "manpages";
54+
rev = "8950e968f4a1ad0b83d5836ec54a070855068dbf";
55+
hash = "sha256-kEVXejDg4ChFoMNBvKlwdFEyUuTcY2VuK9j0PdafKus=";
56+
};
57+
};
6458

6559
meta = {
6660
description = "Blazing fast terminal file manager written in Rust, based on async I/O";
@@ -76,4 +70,4 @@ rustPlatform.buildRustPackage {
7670
];
7771
mainProgram = "yazi";
7872
};
79-
}
73+
})

0 commit comments

Comments
 (0)