summaryrefslogtreecommitdiffstats
path: root/pkgs/rust
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/rust')
-rw-r--r--pkgs/rust/lib/crate2nix-package.nix8
1 files 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';
};
}