From 7d35ad1751fc89f57d85168c9662839fd4bb0a64 Mon Sep 17 00:00:00 2001 From: damocles Date: Fri, 3 Jul 2026 00:15:11 +0200 Subject: [PATCH] =?UTF-8?q?fix(#2167):=20keep=20docs/=20in=20hyperhive=20f?= =?UTF-8?q?lake=20source=20=E2=80=94=20reference-docs=20builds=20from=20it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flake.nix | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/flake.nix b/flake.nix index 4c4b3979..79578b81 100644 --- a/flake.nix +++ b/flake.nix @@ -29,17 +29,23 @@ # Explicit per-consumer source filter for the hyperhive flake path # handed to hive-c0re (`hyperhiveFlake`, below). A filtered view of # this repo that drops files no nix or cargo derivation reads — - # documentation, shell helper scripts, and root-level markdown — so - # editing them does NOT change the store path and therefore does NOT - # force a rebuild of every agent container. + # shell helper scripts and root-level markdown — so editing them + # does NOT change the store path and therefore does NOT force a + # rebuild of every agent container. # # Companion to the rust `cleanSrc` (crane's cargo-source filter): # each real source is a named, explicitly-filtered derivation used # as `src`, rather than an inline filter at the use site. # - # Dropped: docs/, scripts/, root-level *.md (README/CLAUDE/TODO/…). - # Kept (build needs them): .nix, .rs, Cargo.*, branding/, frontend/, - # prompts/, flake.lock. + # Dropped: scripts/, root-level *.md (README/CLAUDE/TODO/…). + # Kept (build needs them): .nix, .rs, Cargo.*, branding/, docs/, + # frontend/, prompts/, flake.lock. docs/ MUST stay in: the + # reference-docs derivation (nix/reference-docs.nix, shipped into + # every agent container via claude --add-dir) builds from ../docs, + # so a flake source without it can't evaluate — container rebuilds + # from the meta flake die with "path …/docs does not exist". The + # rebuild-avoidance for doc edits is gone by design: containers now + # genuinely depend on the docs tree. hyperhiveFlakeSource = lib.cleanSourceWith { name = "hyperhive-flake-source"; src = ./.; @@ -49,8 +55,7 @@ # Repo-relative path (strip the absolute source-dir prefix). rel = lib.removePrefix (toString ./. + "/") (toString path); in - !(lib.hasPrefix "docs/" rel || rel == "docs") - && !(lib.hasPrefix "scripts/" rel || rel == "scripts") + !(lib.hasPrefix "scripts/" rel || rel == "scripts") && !(type == "regular" && !lib.hasInfix "/" rel && lib.hasSuffix ".md" rel); }; treefmt-config = {