diff --git a/nix/desktop-package.nix b/nix/desktop-package.nix index 9703c497ae..cd9c6ca5c2 100644 --- a/nix/desktop-package.nix +++ b/nix/desktop-package.nix @@ -33,6 +33,21 @@ buildNpmPackage rec { && !(lib.hasPrefix "/packages/app/ios" relPath) # Website is unrelated to the desktop app && !(lib.hasPrefix "/packages/website" relPath) + # Documentation, CI definitions and agent/editor configuration. None of + # these reach the build, but every one of them is part of `src`, so a + # docs-only or workflow-only commit currently invalidates the whole + # desktop derivation and pays for a full Expo export to produce a + # byte-identical result. + && !(lib.hasPrefix "/docs" relPath) + && !(lib.hasPrefix "/.github" relPath) + && !(lib.hasPrefix "/.agents" relPath) + && !(lib.hasPrefix "/.claude" relPath) + && !(lib.hasPrefix "/.codex" relPath) + && !(lib.hasPrefix "/docker" relPath) + # Top-level prose only (README, CHANGELOG, AGENTS...). Deeper markdown is + # not necessarily documentation: skills/*/SKILL.md is a runtime file the + # installPhase copies into the output. + && builtins.match "/[^/]+\\.md" relPath == null # Test fixtures and build artifacts && !(lib.hasSuffix ".test.ts" baseName) && !(lib.hasSuffix ".e2e.test.ts" baseName) diff --git a/nix/package.nix b/nix/package.nix index b30665b8c9..417f3d2ad1 100644 --- a/nix/package.nix +++ b/nix/package.nix @@ -37,6 +37,21 @@ buildNpmPackage rec { && !(lib.hasPrefix "/packages/website/public" relPath) && !(lib.hasPrefix "/packages/desktop/src" relPath) && !(lib.hasPrefix "/packages/desktop/src-tauri" relPath) + # Documentation, CI definitions and agent/editor configuration. None of + # these reach the build. Excluding them here also matters for the desktop + # derivation, which inherits this package's npmDeps: leaving them in makes + # a docs-only commit produce a new npm-deps .drv, and so a new desktop + # .drv, and so a full rebuild for a byte-identical result. + && !(lib.hasPrefix "/docs" relPath) + && !(lib.hasPrefix "/.github" relPath) + && !(lib.hasPrefix "/.agents" relPath) + && !(lib.hasPrefix "/.claude" relPath) + && !(lib.hasPrefix "/.codex" relPath) + && !(lib.hasPrefix "/docker" relPath) + # Top-level prose only (README, CHANGELOG, AGENTS...). Deeper markdown is + # not necessarily documentation: skills/*/SKILL.md is a runtime file the + # daemon's trace script copies into the output. + && builtins.match "/[^/]+\\.md" relPath == null # Exclude test fixtures and debug files && !(lib.hasSuffix ".test.ts" baseName) && !(lib.hasSuffix ".e2e.test.ts" baseName)