summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-12-01 02:12:58 +0000
committertv <tv@krebsco.de>2026-12-01 02:12:58 +0000
commit83a81db2eaa0ff9374f8d8a55ed74df883b9c33b (patch)
treeb6822fa6dba7de75766fe966c156b0e822e2e143
parentae61626d5eaa340cd9920df626e4904ed82b2465 (diff)
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.
-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';
};
}
[cgit] Unable to lock slot /tmp/cgit/73300000.lock: Permission denied (13)