From d923fbef3e488b9329f52164a3722316b9f55cde Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Dec 2026 02:12:58 +0000 Subject: crate2nix-package: let extraPaths see the source as built extraPaths may be a function from { src }, the source after pkgs/rust replaced it with a checkout in ~/sync/src, if there is one. --- pkgs/rust/lib/crate2nix-package.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/rust/lib/crate2nix-package.nix b/pkgs/rust/lib/crate2nix-package.nix index 92002cee..3f59858a 100644 --- a/pkgs/rust/lib/crate2nix-package.nix +++ b/pkgs/rust/lib/crate2nix-package.nix @@ -36,7 +36,8 @@ , resolvedJson ? null # Workspace members to build; null: the root crate, or else all members. -# extraPaths get joined to what is built, e.g. documentation. +# extraPaths get joined to what is built, e.g. documentation; a list, or a +# function from { src } to one, for paths made from the source as built. , members ? null , extraPaths ? [] }: @@ -144,10 +145,11 @@ cargoNix // { map (member: cargoNix.workspaceMembers.${member}.build) members else if cargoNix.rootCrate or null != null then [ cargoNix.rootCrate.build ] else [ cargoNix.allWorkspaceMembers ]; + extraPaths' = lib.toFunction extraPaths { inherit src; }; in - if members == null && extraPaths == [] then builtins.head built + if members == null && extraPaths' == [] then builtins.head built else pkgs.symlinkJoin { inherit name; - paths = built ++ extraPaths; + paths = built ++ extraPaths'; }; } -- cgit v1.3.1