From 401d0912b7478e309b956583987440c6db3231d0 Mon Sep 17 00:00:00 2001 From: Hare Date: Fri, 29 May 2026 01:41:09 +0900 Subject: [PATCH] nix: exclude local worktrees from package source --- package.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/package.nix b/package.nix index 1e050bd0..07ba9312 100644 --- a/package.nix +++ b/package.nix @@ -16,13 +16,19 @@ let pathString = toString path; relPath = lib.removePrefix "${srcRootString}/" pathString; baseName = baseNameOf pathString; + isExcludedTree = dir: relPath == dir || lib.hasPrefix "${dir}/" relPath; 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 == "target" || baseName == "result" - || lib.hasPrefix ".insomnia" relPath - || lib.hasPrefix "work-items" relPath + || isExcludedTree ".insomnia" + || isExcludedTree ".worktree" + || isExcludedTree "work-items" + || isExcludedTree "docs/report" ); in rustPlatform.buildRustPackage rec {