nix: exclude local worktrees from package source
This commit is contained in:
parent
b5e608c597
commit
401d0912b7
10
package.nix
10
package.nix
|
|
@ -16,13 +16,19 @@ let
|
||||||
pathString = toString path;
|
pathString = toString path;
|
||||||
relPath = lib.removePrefix "${srcRootString}/" pathString;
|
relPath = lib.removePrefix "${srcRootString}/" pathString;
|
||||||
baseName = baseNameOf pathString;
|
baseName = baseNameOf pathString;
|
||||||
|
isExcludedTree = dir: relPath == dir || lib.hasPrefix "${dir}/" relPath;
|
||||||
in
|
in
|
||||||
|
# Keep the package source closure focused on build inputs: exclude VCS/build
|
||||||
|
# outputs plus local coordination state, generated reports, and child
|
||||||
|
# worktrees that may live under the repository root during development.
|
||||||
!(
|
!(
|
||||||
baseName == ".git"
|
baseName == ".git"
|
||||||
|| baseName == "target"
|
|| baseName == "target"
|
||||||
|| baseName == "result"
|
|| baseName == "result"
|
||||||
|| lib.hasPrefix ".insomnia" relPath
|
|| isExcludedTree ".insomnia"
|
||||||
|| lib.hasPrefix "work-items" relPath
|
|| isExcludedTree ".worktree"
|
||||||
|
|| isExcludedTree "work-items"
|
||||||
|
|| isExcludedTree "docs/report"
|
||||||
);
|
);
|
||||||
in
|
in
|
||||||
rustPlatform.buildRustPackage rec {
|
rustPlatform.buildRustPackage rec {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user