summaryrefslogtreecommitdiffstats
path: root/pkgs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-12-01 02:58:05 +0000
committertv <tv@krebsco.de>2026-12-01 04:42:31 +0100
commit9ad2229ef238482dbfca54e81ae7a07065b20fdd (patch)
treedaa425ce11f38af4da329cc7cb42e818eb6e6bf9 /pkgs
parentbc9b11b3b67671a014779d90998ebd66073eb063 (diff)
crate2nix-package: take meta
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/rust/lib/crate2nix-package.nix15
1 files changed, 10 insertions, 5 deletions
diff --git a/pkgs/rust/lib/crate2nix-package.nix b/pkgs/rust/lib/crate2nix-package.nix
index 3f59858a..dae8fd04 100644
--- a/pkgs/rust/lib/crate2nix-package.nix
+++ b/pkgs/rust/lib/crate2nix-package.nix
@@ -40,6 +40,8 @@
# function from { src } to one, for paths made from the source as built.
, members ? null
, extraPaths ? []
+# Merged into what is built's meta, e.g. mainProgram.
+, meta ? {}
}:
let
@@ -146,10 +148,13 @@ cargoNix // {
else if cargoNix.rootCrate or null != null then [ cargoNix.rootCrate.build ]
else [ cargoNix.allWorkspaceMembers ];
extraPaths' = lib.toFunction extraPaths { inherit src; };
+ package =
+ if members == null && extraPaths' == [] then builtins.head built
+ else pkgs.symlinkJoin {
+ inherit name;
+ paths = built ++ extraPaths';
+ };
in
- if members == null && extraPaths' == [] then builtins.head built
- else pkgs.symlinkJoin {
- inherit name;
- paths = built ++ extraPaths';
- };
+ if meta == {} then package
+ else package // { meta = package.meta or {} // meta; };
}