@smoothbricks/nx-plugin 0.4.26 → 0.4.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (343) hide show
  1. package/README.md +994 -117
  2. package/dist/bin/smoo-nx-bound-failures.d.ts +3 -0
  3. package/dist/bin/smoo-nx-bound-failures.d.ts.map +1 -0
  4. package/dist/bin/smoo-nx-bound-failures.js +31 -0
  5. package/dist/bin/smoo-nx-cargo-hash.js +28 -3
  6. package/dist/bin/smoo-nx-exec.js +15 -73
  7. package/dist/bin/smoo-nx-failures.d.ts +3 -0
  8. package/dist/bin/smoo-nx-failures.d.ts.map +1 -0
  9. package/dist/bin/smoo-nx-failures.js +3 -0
  10. package/dist/bin/smoo-nx-nextest-extract.js +3 -2
  11. package/dist/bin/smoo-nx-test-walks.d.ts +3 -0
  12. package/dist/bin/smoo-nx-test-walks.d.ts.map +1 -0
  13. package/dist/bin/smoo-nx-test-walks.js +34 -0
  14. package/dist/bounded-test-policy.d.ts +7 -1
  15. package/dist/bounded-test-policy.d.ts.map +1 -1
  16. package/dist/bounded-test-policy.js +101 -40
  17. package/dist/build-state-output-policy.d.ts +25 -0
  18. package/dist/build-state-output-policy.d.ts.map +1 -0
  19. package/dist/build-state-output-policy.js +64 -0
  20. package/dist/cargo-closure-input.d.ts +3 -2
  21. package/dist/cargo-closure-input.d.ts.map +1 -1
  22. package/dist/cargo-closure-input.js +16 -15
  23. package/dist/cargo-dev-profile.d.ts +37 -0
  24. package/dist/cargo-dev-profile.d.ts.map +1 -0
  25. package/dist/cargo-dev-profile.js +108 -0
  26. package/dist/cargo-source-hash.d.ts +43 -6
  27. package/dist/cargo-source-hash.d.ts.map +1 -1
  28. package/dist/cargo-source-hash.js +309 -73
  29. package/dist/cargo-toolchain-policy.d.ts +4 -0
  30. package/dist/cargo-toolchain-policy.d.ts.map +1 -1
  31. package/dist/cargo-toolchain-policy.js +5 -0
  32. package/dist/cargo-workspace.d.ts +101 -5
  33. package/dist/cargo-workspace.d.ts.map +1 -1
  34. package/dist/cargo-workspace.js +291 -10
  35. package/dist/cross-check-policy.d.ts +21 -3
  36. package/dist/cross-check-policy.d.ts.map +1 -1
  37. package/dist/cross-check-policy.js +24 -6
  38. package/dist/disk-command-policy.d.ts +7 -0
  39. package/dist/disk-command-policy.d.ts.map +1 -0
  40. package/dist/disk-command-policy.js +98 -0
  41. package/dist/ensure-built-receipt.d.ts +25 -0
  42. package/dist/ensure-built-receipt.d.ts.map +1 -0
  43. package/dist/ensure-built-receipt.js +261 -0
  44. package/dist/ensure-built-witness.d.ts +57 -0
  45. package/dist/ensure-built-witness.d.ts.map +1 -0
  46. package/dist/ensure-built-witness.js +412 -0
  47. package/dist/ensure-built.d.ts +207 -12
  48. package/dist/ensure-built.d.ts.map +1 -1
  49. package/dist/ensure-built.js +576 -202
  50. package/dist/eslint-file-set.d.ts +7 -0
  51. package/dist/eslint-file-set.d.ts.map +1 -0
  52. package/dist/eslint-file-set.js +12 -0
  53. package/dist/executors/bounded-exec/cpu-pool.d.ts +63 -0
  54. package/dist/executors/bounded-exec/cpu-pool.d.ts.map +1 -0
  55. package/dist/executors/bounded-exec/cpu-pool.js +379 -0
  56. package/dist/executors/bounded-exec/cpu-tokens.d.ts +82 -0
  57. package/dist/executors/bounded-exec/cpu-tokens.d.ts.map +1 -0
  58. package/dist/executors/bounded-exec/cpu-tokens.js +114 -0
  59. package/dist/executors/bounded-exec/disk-lease.d.ts +61 -0
  60. package/dist/executors/bounded-exec/disk-lease.d.ts.map +1 -0
  61. package/dist/executors/bounded-exec/disk-lease.js +91 -0
  62. package/dist/executors/bounded-exec/executor.d.ts +45 -2
  63. package/dist/executors/bounded-exec/executor.d.ts.map +1 -1
  64. package/dist/executors/bounded-exec/executor.js +447 -52
  65. package/dist/executors/bounded-exec/gateway-lease.d.ts +52 -0
  66. package/dist/executors/bounded-exec/gateway-lease.d.ts.map +1 -0
  67. package/dist/executors/bounded-exec/gateway-lease.js +143 -0
  68. package/dist/executors/bounded-exec/hang-diagnostics.d.ts +35 -0
  69. package/dist/executors/bounded-exec/hang-diagnostics.d.ts.map +1 -0
  70. package/dist/executors/bounded-exec/hang-diagnostics.js +231 -0
  71. package/dist/executors/bounded-exec/progress.d.ts +35 -0
  72. package/dist/executors/bounded-exec/progress.d.ts.map +1 -0
  73. package/dist/executors/bounded-exec/progress.js +79 -0
  74. package/dist/executors/bounded-exec/ram-temp-fixtures.d.ts +3 -0
  75. package/dist/executors/bounded-exec/ram-temp-fixtures.d.ts.map +1 -0
  76. package/dist/executors/bounded-exec/ram-temp-fixtures.js +12 -0
  77. package/dist/executors/bounded-exec/ram-temp-held.d.ts +91 -0
  78. package/dist/executors/bounded-exec/ram-temp-held.d.ts.map +1 -0
  79. package/dist/executors/bounded-exec/ram-temp-held.js +152 -0
  80. package/dist/executors/bounded-exec/ram-temp.d.ts +223 -0
  81. package/dist/executors/bounded-exec/ram-temp.d.ts.map +1 -0
  82. package/dist/executors/bounded-exec/ram-temp.js +1528 -0
  83. package/dist/executors/bounded-exec/schema.d.ts +29 -11
  84. package/dist/executors/bounded-exec/schema.d.ts.map +1 -1
  85. package/dist/executors/bounded-exec/verdict.d.ts +162 -0
  86. package/dist/executors/bounded-exec/verdict.d.ts.map +1 -0
  87. package/dist/executors/bounded-exec/verdict.js +318 -0
  88. package/dist/executors/shard-timings/executor.d.ts +14 -0
  89. package/dist/executors/shard-timings/executor.d.ts.map +1 -0
  90. package/dist/executors/shard-timings/executor.js +25 -0
  91. package/dist/executors/shard-timings/schema.d.ts +4 -0
  92. package/dist/executors/shard-timings/schema.d.ts.map +1 -0
  93. package/dist/executors/shard-timings/schema.js +1 -0
  94. package/dist/failure-summary.d.ts +5 -0
  95. package/dist/failure-summary.d.ts.map +1 -0
  96. package/dist/failure-summary.js +118 -0
  97. package/dist/generators/create-package/generator.d.ts.map +1 -1
  98. package/dist/generators/create-package/generator.js +6 -2
  99. package/dist/index.d.ts +14 -2
  100. package/dist/index.d.ts.map +1 -1
  101. package/dist/index.js +370 -138
  102. package/dist/managed-files/ci-workflow.d.ts +13 -0
  103. package/dist/managed-files/ci-workflow.d.ts.map +1 -1
  104. package/dist/managed-files/ci-workflow.js +44 -13
  105. package/dist/managed-files/files.d.ts +7 -1
  106. package/dist/managed-files/files.d.ts.map +1 -1
  107. package/dist/managed-files/files.js +62 -8
  108. package/dist/managed-files/json-edit.d.ts +21 -0
  109. package/dist/managed-files/json-edit.d.ts.map +1 -0
  110. package/dist/managed-files/json-edit.js +295 -0
  111. package/dist/managed-files/managed-format.d.ts +33 -1
  112. package/dist/managed-files/managed-format.d.ts.map +1 -1
  113. package/dist/managed-files/managed-format.js +82 -2
  114. package/dist/managed-files/pr-preview-cleanup-workflow.d.ts +7 -0
  115. package/dist/managed-files/pr-preview-cleanup-workflow.d.ts.map +1 -1
  116. package/dist/managed-files/pr-preview-cleanup-workflow.js +68 -4
  117. package/dist/managed-files/publish-workflow.d.ts.map +1 -1
  118. package/dist/managed-files/publish-workflow.js +231 -48
  119. package/dist/managed-files/tree.d.ts +5 -0
  120. package/dist/managed-files/tree.d.ts.map +1 -1
  121. package/dist/managed-files/tree.js +5 -3
  122. package/dist/manifest-hash.d.ts.map +1 -1
  123. package/dist/manifest-hash.js +2 -5
  124. package/dist/nextest-code-bound.d.ts +62 -0
  125. package/dist/nextest-code-bound.d.ts.map +1 -0
  126. package/dist/nextest-code-bound.js +154 -0
  127. package/dist/nextest-extraction.d.ts +24 -8
  128. package/dist/nextest-extraction.d.ts.map +1 -1
  129. package/dist/nextest-extraction.js +42 -7
  130. package/dist/package-target-policy.d.ts.map +1 -1
  131. package/dist/package-target-policy.js +3 -5
  132. package/dist/release-config-policy.d.ts.map +1 -1
  133. package/dist/release-config-policy.js +3 -5
  134. package/dist/runtime-input.d.ts +14 -0
  135. package/dist/runtime-input.d.ts.map +1 -0
  136. package/dist/runtime-input.js +15 -0
  137. package/dist/rust-tokens.d.ts +11 -0
  138. package/dist/rust-tokens.d.ts.map +1 -0
  139. package/dist/rust-tokens.js +81 -0
  140. package/dist/task-results.d.ts +6 -0
  141. package/dist/task-results.d.ts.map +1 -0
  142. package/dist/task-results.js +61 -0
  143. package/dist/test-program.d.ts +54 -0
  144. package/dist/test-program.d.ts.map +1 -0
  145. package/dist/test-program.js +292 -0
  146. package/dist/test-timings.d.ts +71 -0
  147. package/dist/test-timings.d.ts.map +1 -0
  148. package/dist/test-timings.js +393 -0
  149. package/dist/test-walk-policy.d.ts +103 -0
  150. package/dist/test-walk-policy.d.ts.map +1 -0
  151. package/dist/test-walk-policy.js +657 -0
  152. package/dist/testing.d.ts +177 -0
  153. package/dist/testing.d.ts.map +1 -0
  154. package/dist/testing.js +824 -0
  155. package/dist/type-guards.d.ts +3 -0
  156. package/dist/type-guards.d.ts.map +1 -0
  157. package/dist/type-guards.js +4 -0
  158. package/dist/typecheck-test-policy.d.ts +8 -5
  159. package/dist/typecheck-test-policy.d.ts.map +1 -1
  160. package/dist/typecheck-test-policy.js +113 -100
  161. package/dist/workspace-config-policy.d.ts +8 -0
  162. package/dist/workspace-config-policy.d.ts.map +1 -1
  163. package/dist/workspace-config-policy.js +175 -63
  164. package/dist/workspace-index.d.ts +12 -0
  165. package/dist/workspace-index.d.ts.map +1 -0
  166. package/dist/workspace-index.js +17 -0
  167. package/dist/workspace-manifest.d.ts +37 -0
  168. package/dist/workspace-manifest.d.ts.map +1 -1
  169. package/executors.json +5 -0
  170. package/loader.js +13 -11
  171. package/managed/raw/envrc +33 -67
  172. package/managed/raw/git-format-staged.yml +30 -35
  173. package/managed/raw/patches/nx@23.2.1.patch +3484 -0
  174. package/managed/raw/tooling/direnv/apple-developer.sh +83 -0
  175. package/managed/raw/tooling/direnv/developer-links.ts +569 -11
  176. package/managed/raw/tooling/direnv/devenv.smoo.nix +314 -93
  177. package/managed/raw/tooling/direnv/github-actions-bootstrap.sh +20 -11
  178. package/managed/raw/tooling/direnv/linked-snapshots.ts +845 -0
  179. package/managed/raw/tooling/direnv/nx-socket-dir.sh +82 -0
  180. package/managed/raw/tooling/direnv/repo-path +14 -2
  181. package/managed/raw/tooling/direnv/setup-environment.ts +962 -148
  182. package/managed/raw/tooling/direnv/toolchain-stamp.ts +45 -3
  183. package/managed/raw/tooling/direnv/ttsc-env.sh +39 -0
  184. package/managed/raw/tooling/git-hooks/commit-msg.sh +5 -6
  185. package/managed/raw/tooling/git-hooks/pre-commit.sh +7 -6
  186. package/managed/raw/tooling/git-hooks/pre-push.sh +20 -15
  187. package/managed/templates/github/actions/cache-nix-devenv/action.yml +6 -6
  188. package/managed/templates/github/actions/cache-node-modules/action.yml +6 -4
  189. package/managed/templates/github/actions/cache-nx/action.yml +1 -1
  190. package/managed/templates/github/actions/cache-ttsc-plugins/action.yml +1 -1
  191. package/managed/templates/github/actions/forgejo-artifact.cjs +99 -0
  192. package/managed/templates/github/actions/forgejo-download-artifact/action.yml +49 -0
  193. package/managed/templates/github/actions/forgejo-download-artifact/index.cjs +7 -0
  194. package/managed/templates/github/actions/forgejo-upload-artifact/action.yml +65 -0
  195. package/managed/templates/github/actions/forgejo-upload-artifact/index.cjs +7 -0
  196. package/managed/templates/github/actions/setup-devenv/action.yml +21 -3
  197. package/managed/templates/github/workflows/managed-files.yml +1 -2
  198. package/nextest.toml +8 -41
  199. package/package.json +74 -12
  200. package/runtime-input.sh +81 -0
  201. package/src/__tests__/counted-cargo.ts +33 -14
  202. package/src/__tests__/fixture-nx-env.ts +111 -46
  203. package/src/__tests__/progress-clock.ts +43 -0
  204. package/src/__tests__/runtime-input.ts +23 -0
  205. package/src/bin/smoo-nx-bound-failures.test.ts +127 -0
  206. package/src/bin/smoo-nx-bound-failures.ts +33 -0
  207. package/src/bin/smoo-nx-cargo-hash.ts +28 -3
  208. package/src/bin/smoo-nx-exec.ts +16 -74
  209. package/src/bin/smoo-nx-failures.ts +4 -0
  210. package/src/bin/smoo-nx-nextest-extract.ts +3 -2
  211. package/src/bin/smoo-nx-test-walks.ts +42 -0
  212. package/src/bounded-test-policy.test.ts +268 -21
  213. package/src/bounded-test-policy.ts +114 -42
  214. package/src/build-state-output-policy.test.ts +115 -0
  215. package/src/build-state-output-policy.ts +90 -0
  216. package/src/bun-bootstrap.test.ts +57 -3
  217. package/src/bun-file-packages.test.ts +47 -0
  218. package/src/cargo-closure-input.test.ts +138 -66
  219. package/src/cargo-closure-input.ts +17 -15
  220. package/src/cargo-dev-profile.ts +137 -0
  221. package/src/cargo-resolve-cache.test.ts +70 -1
  222. package/src/cargo-source-hash.test.ts +193 -97
  223. package/src/cargo-source-hash.ts +345 -68
  224. package/src/cargo-toolchain-policy.ts +6 -0
  225. package/src/cargo-workspace.test.ts +320 -0
  226. package/src/cargo-workspace.ts +336 -10
  227. package/src/cross-check-policy.test.ts +59 -1
  228. package/src/cross-check-policy.ts +25 -6
  229. package/src/disk-command-policy.test.ts +61 -0
  230. package/src/disk-command-policy.ts +107 -0
  231. package/src/ensure-built-receipt.test.ts +184 -0
  232. package/src/ensure-built-receipt.ts +263 -0
  233. package/src/ensure-built-witness.test.ts +344 -0
  234. package/src/ensure-built-witness.ts +252 -0
  235. package/src/ensure-built.test.ts +1036 -578
  236. package/src/ensure-built.ts +820 -224
  237. package/src/eslint-file-set.ts +9 -0
  238. package/src/executors/bounded-exec/cpu-pool.test.ts +454 -0
  239. package/src/executors/bounded-exec/cpu-pool.ts +417 -0
  240. package/src/executors/bounded-exec/cpu-tokens.test.ts +269 -0
  241. package/src/executors/bounded-exec/cpu-tokens.ts +177 -0
  242. package/src/executors/bounded-exec/disk-lease.test.ts +185 -0
  243. package/src/executors/bounded-exec/disk-lease.ts +139 -0
  244. package/src/executors/bounded-exec/executor-host.test.ts +778 -0
  245. package/src/executors/bounded-exec/executor.test.ts +1116 -63
  246. package/src/executors/bounded-exec/executor.ts +565 -67
  247. package/src/executors/bounded-exec/gateway-lease.ts +176 -0
  248. package/src/executors/bounded-exec/hang-diagnostics.test.ts +285 -0
  249. package/src/executors/bounded-exec/hang-diagnostics.ts +283 -0
  250. package/src/executors/bounded-exec/progress.test.ts +79 -0
  251. package/src/executors/bounded-exec/progress.ts +118 -0
  252. package/src/executors/bounded-exec/ram-temp-fixtures.ts +12 -0
  253. package/src/executors/bounded-exec/ram-temp-held.test.ts +264 -0
  254. package/src/executors/bounded-exec/ram-temp-held.ts +242 -0
  255. package/src/executors/bounded-exec/ram-temp-host.test.ts +605 -0
  256. package/src/executors/bounded-exec/ram-temp.test.ts +674 -0
  257. package/src/executors/bounded-exec/ram-temp.ts +1918 -0
  258. package/src/executors/bounded-exec/schema.json +11 -5
  259. package/src/executors/bounded-exec/schema.ts +27 -11
  260. package/src/executors/bounded-exec/verdict.test.ts +440 -0
  261. package/src/executors/bounded-exec/verdict.ts +433 -0
  262. package/src/executors/shard-timings/executor.ts +36 -0
  263. package/src/executors/shard-timings/schema.json +21 -0
  264. package/src/executors/shard-timings/schema.ts +4 -0
  265. package/src/failure-summary.ts +119 -0
  266. package/src/generators/bounded-test-targets/generator.test.ts +4 -4
  267. package/src/generators/bun-test-tracing/generator.test.ts +2 -2
  268. package/src/generators/create-package/generator.test.ts +6 -0
  269. package/src/generators/create-package/generator.ts +6 -2
  270. package/src/host-controller-wiring.test.ts +31 -0
  271. package/src/index.test.ts +909 -295
  272. package/src/index.ts +441 -143
  273. package/src/linked-snapshots.nx.test.ts +172 -0
  274. package/src/managed-files/ci-workflow.ts +54 -13
  275. package/src/managed-files/files.ts +65 -9
  276. package/src/managed-files/forgejo-artifact.test.ts +395 -0
  277. package/src/managed-files/generator.test.ts +60 -1
  278. package/src/managed-files/json-edit.test.ts +216 -0
  279. package/src/managed-files/json-edit.ts +290 -0
  280. package/src/managed-files/managed-format-json.test.ts +308 -0
  281. package/src/managed-files/managed-format.ts +90 -2
  282. package/src/managed-files/pr-preview-cleanup-workflow.ts +69 -3
  283. package/src/managed-files/publish-workflow.ts +285 -67
  284. package/src/managed-files/repo-path.test.ts +129 -0
  285. package/src/managed-files/trace-db-artifact.test.ts +7 -0
  286. package/src/managed-files/tree.ts +11 -3
  287. package/src/manifest-hash.ts +2 -6
  288. package/src/nextest-code-bound.test.ts +155 -0
  289. package/src/nextest-code-bound.ts +195 -0
  290. package/src/nextest-extraction.test.ts +37 -5
  291. package/src/nextest-extraction.ts +51 -9
  292. package/src/nextest-partitions.test.ts +427 -82
  293. package/src/nx-cache-bound.test.ts +5 -10
  294. package/src/nx-cache-restore-mtime.test.ts +170 -0
  295. package/src/nx-daemon-claim.test.ts +277 -0
  296. package/src/nx-daemon-idle-cpu.test.ts +81 -0
  297. package/src/nx-daemon-idle-policy.test.ts +51 -0
  298. package/src/nx-daemon-ignore-files.test.ts +210 -0
  299. package/src/nx-daemon-root-normalization.test.ts +105 -0
  300. package/src/nx-daemon-validity.test.ts +925 -0
  301. package/src/nx-dot-input-policy.test.ts +353 -0
  302. package/src/nx-failure-life-cycles.test.ts +207 -0
  303. package/src/nx-files-archive-racy.test.ts +97 -0
  304. package/src/nx-foreign-workspace-env.test.ts +329 -0
  305. package/src/nx-incomplete-run-summary.test.ts +70 -0
  306. package/src/nx-plugin-load-errors.test.ts +120 -0
  307. package/src/nx-project-resolution-cache.test.ts +176 -0
  308. package/src/nx-raw-inputs.test.ts +166 -0
  309. package/src/nx-resident-graph-workers.test.ts +7 -16
  310. package/src/nx-run-information.test.ts +118 -0
  311. package/src/nx-skipped-task-exit.test.ts +180 -0
  312. package/src/nx-state-location.test.ts +63 -0
  313. package/src/nx-store-resolution.test.ts +26 -25
  314. package/src/nx-task-graph-cycles.test.ts +148 -0
  315. package/src/nx-task-output-lease.test.ts +414 -0
  316. package/src/nx-use-local.test.ts +103 -0
  317. package/src/package-target-policy.ts +3 -6
  318. package/src/release-config-policy.ts +3 -6
  319. package/src/runtime-input.test.ts +215 -0
  320. package/src/runtime-input.ts +17 -0
  321. package/src/rust-tokens.ts +78 -0
  322. package/src/serial-group-wiring.test.ts +326 -0
  323. package/src/task-history-namespace.test.ts +87 -89
  324. package/src/task-results.test.ts +226 -0
  325. package/src/task-results.ts +75 -0
  326. package/src/test-program.test.ts +303 -0
  327. package/src/test-program.ts +341 -0
  328. package/src/test-timings.test.ts +240 -0
  329. package/src/test-timings.ts +311 -0
  330. package/src/test-walk-policy.test.ts +585 -0
  331. package/src/test-walk-policy.ts +731 -0
  332. package/src/testing.test.ts +509 -0
  333. package/src/testing.ts +922 -0
  334. package/src/type-guards.ts +4 -0
  335. package/src/typecheck-test-policy.test.ts +496 -11
  336. package/src/typecheck-test-policy.ts +137 -103
  337. package/src/workspace-config-policy.test.ts +212 -13
  338. package/src/workspace-config-policy.ts +101 -73
  339. package/src/workspace-index.ts +18 -0
  340. package/src/workspace-manifest.ts +41 -0
  341. package/test-timings.json +85 -30
  342. package/managed/raw/tooling/direnv/inherited-devenv.ts +0 -665
  343. package/managed/raw/tooling/direnv/shared-caches.sh +0 -53
@@ -31,12 +31,128 @@
31
31
  hash = "sha256-ebjX+1+9axEqsnZXCRZSumA38gPNdmoz98tMt2oftN4=";
32
32
  };
33
33
 
34
+ # The nixpkgs the Go pin below comes from (devenv.yaml `nixpkgs-go`).
35
+ goPkgs = import inputs.nixpkgs-go {inherit (pkgs.stdenv.hostPlatform) system;};
36
+
37
+ # The native TypeScript compiler typecheck targets run, built from a pinned
38
+ # source revision rather than taken from the npm `@typescript/native` binary
39
+ # that emit, editors and ttsc plugins keep using. The Nx plugin's inferred
40
+ # `typecheck` and `typecheck-tests` run it directly (not through ttsc, whose
41
+ # auto-loaded typia host checks with its own compiler) and hash this path as
42
+ # an input, so a revision bump is a cache miss.
43
+ #
44
+ # The revision is can1357/TypeScript perf/checker-speedups-v3: 36 checker,
45
+ # arena and scheduler commits on microsoft/TypeScript main 6ad8c56f9b5a,
46
+ # while they are upstreamed. Its Go module (tsc/, Go 1.27) builds with the
47
+ # nixpkgs-go input's go_1_27 inside this derivation; the shell's own Go stays the
48
+ # one ttsc vendors. The sparse checkout keeps the ~61k test baselines out of
49
+ # the store, and GOWORK=off keeps the repository's go.work (tools/) out of
50
+ # the module build.
51
+ typecheckTsc = goPkgs.buildGo127Module {
52
+ pname = "tsc";
53
+ version = "7.1.0-dev-c1ae0cde";
54
+ src = pkgs.fetchFromGitHub {
55
+ owner = "can1357";
56
+ repo = "TypeScript";
57
+ rev = "c1ae0cde041b8aa08600198fad014d869c83b602";
58
+ sparseCheckout = ["tsc/cmd" "tsc/internal"];
59
+ hash = "sha256-X4wKd/+b4EGMGwXGpfQ5YHkgfqqtPgfyf3x1maEuE+4=";
60
+ };
61
+ modRoot = "tsc";
62
+ subPackages = ["cmd/tsc"];
63
+ vendorHash = "sha256-XmN6VfL922FqKUHRnBfGTuEUFbPELf8F6JINVMTz1/w=";
64
+ env = {
65
+ CGO_ENABLED = "0";
66
+ GOWORK = "off";
67
+ };
68
+ ldflags = ["-s" "-w"];
69
+ # Upstream's tests run against the full checkout's baselines, which the
70
+ # sparse source omits; the revision is the tested artifact.
71
+ doCheck = false;
72
+ };
73
+
34
74
  # A repository that enables uv under languages.python gets its uv workspace
35
75
  # synced and activated by this contract (enterShell item 5), never by
36
76
  # devenv's own python tasks.
37
77
  python = config.languages.python;
38
78
  uvProject = python.enable && python.uv.enable;
79
+
80
+ # The Rust toolchain's own store bin, put ahead of this checkout's profile on
81
+ # PATH (enterShell item 2). `cargo clippy` runs `cargo-clippy`, which sets
82
+ # RUSTC_WORKSPACE_WRAPPER to the clippy-driver beside its own executable path
83
+ # (current_exe, which on Darwin is the path that was executed, symlinks
84
+ # unresolved), and cargo hashes that wrapper path into the identity of every
85
+ # workspace unit it checks. Reached through
86
+ # `<checkout>/tooling/direnv/.devenv/profile/bin`, the wrapper names the
87
+ # checkout, so a copy-on-write clone at another path re-checks every
88
+ # workspace crate under fresh unit directories although its target/ arrived
89
+ # warm, and the stale ones pile up per checkout. Resolved here, cargo,
90
+ # cargo-clippy and clippy-driver are one store path in every checkout.
91
+ # rustc resolves here too, but cargo keys units on its `-vV` output and not
92
+ # its path, so plain builds keep their units. The profile still carries the
93
+ # same files for anything that names it.
94
+ rustToolchainBin = "${config.languages.rust.toolchainPackage}/bin";
95
+
96
+ # Expose pyflakes without propagating a second interpreter into the shell.
97
+ pyflakesBin = pkgs.runCommandLocal "pyflakes-${pkgs.python3Packages.pyflakes.version}" {} ''
98
+ mkdir -p "$out/bin"
99
+ ln -s ${pkgs.python3Packages.pyflakes}/bin/pyflakes "$out/bin/pyflakes"
100
+ '';
39
101
  in {
102
+ # nixpkgs carries actionlint, not the jdx fork. Supply the immutable upstream
103
+ # release as a normal package, with the same pin in developer shells and CI.
104
+ # Nix fetches/verifies it once; validation never installs or compiles a tool.
105
+ overlays = [
106
+ (_final: prev: let
107
+ sources = {
108
+ aarch64-darwin = {
109
+ platform = "darwin_arm64";
110
+ hash = "sha256-GtIQvSH0xwqB4L/+zG0iPayo3RPlf6aJl4cGT4tyTHw=";
111
+ };
112
+ x86_64-darwin = {
113
+ platform = "darwin_amd64";
114
+ hash = "sha256-A8y1LzvzxrG2NYaJpNMeXwXVWLMsC47a6sfEUqvn//Q=";
115
+ };
116
+ aarch64-linux = {
117
+ platform = "linux_arm64";
118
+ hash = "sha256-l4qfMsxO0dgblFY/xJZDuLOkjcuk0eoInZugX34X56c=";
119
+ };
120
+ x86_64-linux = {
121
+ platform = "linux_amd64";
122
+ hash = "sha256-AmvObQ7xlvWyK/Q6yxNI1HxdClrmHW7DvboSKagjFhs=";
123
+ };
124
+ };
125
+ system = prev.stdenv.hostPlatform.system;
126
+ source = sources.${system} or (throw "jactionlint: unsupported managed shell platform ${system}");
127
+ in {
128
+ jactionlint = prev.stdenvNoCC.mkDerivation rec {
129
+ pname = "jactionlint";
130
+ version = "2.0.2";
131
+ src = prev.fetchurl {
132
+ url = "https://github.com/jdx/jactionlint/releases/download/v${version}/jactionlint_${version}_${source.platform}.tar.gz";
133
+ inherit (source) hash;
134
+ };
135
+ sourceRoot = ".";
136
+ dontConfigure = true;
137
+ dontBuild = true;
138
+ # Preserve the upstream signed macOS executable; no strip/patch phase.
139
+ dontFixup = true;
140
+ installPhase = ''
141
+ runHook preInstall
142
+ install -Dm755 jactionlint "$out/bin/jactionlint"
143
+ runHook postInstall
144
+ '';
145
+ meta = {
146
+ description = "Static correctness, security and policy checker for GitHub Actions";
147
+ homepage = "https://github.com/jdx/jactionlint";
148
+ license = lib.licenses.mit;
149
+ mainProgram = "jactionlint";
150
+ platforms = builtins.attrNames sources;
151
+ };
152
+ };
153
+ })
154
+ ];
155
+
40
156
  env = lib.mkMerge [
41
157
  {
42
158
  # Nx otherwise defaults to three workers. Scale to the cores available in each
@@ -54,6 +170,7 @@ in {
54
170
  # `NX_USE_LOCAL=false nx migrate` restores that for the one command.
55
171
  NX_USE_LOCAL = "true";
56
172
  TTSC_TYPESCRIPT_GO_DIR = "${typescriptGo}";
173
+ SMOO_TYPECHECK_TSC = "${typecheckTsc}/bin/tsc";
57
174
  }
58
175
  # Playwright's downloaded Ubuntu browser has no runtime closure on NixOS
59
176
  # (CI reached the executable, then failed loading libglib-2.0.so.0). Use
@@ -63,6 +180,17 @@ in {
63
180
  PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH = lib.getExe pkgs.chromium;
64
181
  })
65
182
  ];
183
+
184
+ # devenv's Cachix integration adds one substituter, devenv.cachix.org, whose
185
+ # signing key it fetches from the Cachix API whenever its per-user key file
186
+ # (cachix_trusted_keys.json) lacks it. That cache holds nothing this shell
187
+ # pulls: its packages come from devenv-nixpkgs, whose store paths
188
+ # cache.nixos.org already serves, and the rest are built here. Off, devenv
189
+ # makes no network call before evaluating, which matters wherever the API is
190
+ # unreachable (a cowshed sandbox's gateway, an offline host). A host that
191
+ # wants the cache anyway names it in its own nix.conf.
192
+ cachix.enable = false;
193
+
66
194
  # sccache is deliberately absent from this shell. It used to export
67
195
  # RUSTC_WRAPPER=sccache as a BARE NAME, which PATH then resolved per project —
68
196
  # which is precisely how an unpatched binary from one profile came to serve
@@ -202,23 +330,23 @@ in {
202
330
 
203
331
  # One Go for every repository, same reasoning as the Rust toolchain: a compiler
204
332
  # is part of a cache key, so two of them mean two caches.
333
+ # The typecheck compiler's Go 1.27 above is a build input of that one
334
+ # derivation only: no shell, plugin or repository build ever runs it.
205
335
  #
206
- # Pinned to the patch release ttsc vendors inside its native package, because
207
- # that SDK is not overridable — ttsc exposes cache locations and
208
- # TTSC_TSGO_BINARY, never the Go it builds plugins with — so matching it is the
209
- # only way to have ONE Go rather than ours plus a dependency's. `smoo monorepo
210
- # check` enforces the match and fails with both versions when they diverge,
211
- # which is what makes this pin a maintained invariant instead of a comment that
212
- # rots.
336
+ # Pinned to the patch release ttsc vendors inside its native package: ttsc
337
+ # builds plugins with that SDK unless TTSC_GO_BINARY names another, so matching
338
+ # it is how there is ONE Go rather than ours plus a dependency's. `smoo
339
+ # monorepo check` enforces the match and fails with both versions when they
340
+ # diverge, which is what makes this pin a maintained invariant instead of a
341
+ # comment that rots.
213
342
  #
214
343
  # It needs its own input because the fleet's nixpkgs does not carry that patch:
215
- # devenv-nixpkgs rolling ships go 1.26.5 and its `go_1_27` is a release
216
- # candidate, while ttsc 0.28.3 vendors go1.26.7. Same idiom, and same reason,
217
- # for any single-package pin — one leaf package from a nixpkgs that has it,
218
- # lock-pinned, prebuilt, rather than a fleet-wide bump that would move rustc,
219
- # bun and node too. Not every pairing is reachable: ttsc 0.28.1/0.28.2 vendor
220
- # go1.26.6, which NO channel packages, so when no revision offers the vendored
221
- # patch the ttsc pin is what moves.
344
+ # devenv-nixpkgs rolling ships go 1.26.5, while ttsc 0.30.4 vendors go1.26.8.
345
+ # Same idiom, and same reason, for any single-package pin — one leaf package
346
+ # from a nixpkgs that has it, lock-pinned, prebuilt, rather than a fleet-wide
347
+ # bump that would move rustc, bun and node too. Not every pairing is
348
+ # reachable: ttsc 0.28.1/0.28.2 vendor go1.26.6, which NO channel packages, so
349
+ # when no revision offers the vendored patch the ttsc pin is what moves.
222
350
  #
223
351
  # The ownership boundary this pin sits inside, unchanged by it: our code is
224
352
  # built with the Go devenv provides, a dependency may vendor its own SDK, and
@@ -253,9 +381,14 @@ in {
253
381
  # `nixpkgs_2`.
254
382
  packages =
255
383
  [
256
- (import inputs.nixpkgs-go {inherit (pkgs.stdenv.hostPlatform) system;}).go
384
+ goPkgs.go
257
385
  pkgs.nodejs_26
258
386
  pkgs.binaryen
387
+ # Smoo's GitHub Actions validator uses the managed prebuilt package above.
388
+ pkgs.jactionlint
389
+ # Keep jactionlint's default shell and Python checks in the same pinned closure.
390
+ pkgs.shellcheck-minimal
391
+ pyflakesBin
259
392
  # Test runner for inferred Cargo test targets. Generated targets must never
260
393
  # depend on an ambient host installation that CI does not reproduce.
261
394
  pkgs.cargo-nextest
@@ -276,12 +409,124 @@ in {
276
409
  # devenv wraps the Python interpreter to find native libraries in
277
410
  # `languages.python.libraries`, whose default is this checkout's
278
411
  # `.devenv/profile`. That path then lands in the interpreter's store path, the
279
- # profile that holds it and the uv environment built with it, so every clone
280
- # evaluates and builds its own interpreter and profile on first entry, and its
281
- # copied uv environment names another checkout's interpreter. Cleared, the
282
- # interpreter is one store path in every checkout. devenv still adds the C++
283
- # runtime; a wheel that needs another library names that library here.
284
- languages.python.libraries = lib.mkIf uvProject (lib.mkDefault []);
412
+ # profile that holds it, PKG_CONFIG_PATH and the uv environment built with it,
413
+ # so every clone evaluates and builds its own interpreter and profile on first
414
+ # entry, every cache keyed on the build environment misses — ttsc hashes
415
+ # PKG_CONFIG_PATH into its plugin key and rebuilds the Go plugin per clone —
416
+ # and a copied uv environment names another checkout's interpreter. Cleared,
417
+ # the interpreter is one store path in every checkout. devenv still adds the
418
+ # C++ runtime; a wheel that needs another library names that library here.
419
+ languages.python.libraries = lib.mkDefault [];
420
+
421
+ # The stdenv build variables the shell derivation leaks beyond the ones devenv
422
+ # already drops: generic names (`name`, `system`) that collide with any
423
+ # script's own, and builder-only settings (NIX_CFLAGS_COMPILE,
424
+ # SOURCE_DATE_EPOCH, the sandbox profiles) that change what a compiler run
425
+ # from the shell produces. The shell is a place to run tools, not a builder.
426
+ # mkOptionDefault: devenv's own default list stays, this one joins it.
427
+ unsetEnvVars = lib.mkOptionDefault [
428
+ "CONFIG_SHELL"
429
+ "DETERMINISTIC_BUILD"
430
+ "IN_NIX_SHELL"
431
+ "MACOSX_DEPLOYMENT_TARGET"
432
+ "NIX_CFLAGS_COMPILE"
433
+ "NIX_COREFOUNDATION_RPATH"
434
+ "NIX_DONT_SET_RPATH"
435
+ "NIX_DONT_SET_RPATH_FOR_BUILD"
436
+ "NIX_ENFORCE_NO_NATIVE"
437
+ "NIX_IGNORE_LD_THROUGH_GCC"
438
+ "NIX_INDENT_MAKE"
439
+ "NIX_NO_SELF_RPATH"
440
+ "NIX_STORE"
441
+ "PATH_LOCALE"
442
+ "SOURCE_DATE_EPOCH"
443
+ "__darwinAllowLocalNetworking"
444
+ "__impureHostDeps"
445
+ "__propagatedImpureHostDeps"
446
+ "__propagatedSandboxProfile"
447
+ "__sandboxProfile"
448
+ "cmakeFlags"
449
+ "configureFlags"
450
+ "mesonFlags"
451
+ "name"
452
+ "system"
453
+ ];
454
+
455
+ # Shell entry's installs are devenv tasks ordered before devenv:enterShell, so
456
+ # devenv decides when they run and an unchanged checkout starts no installer.
457
+ #
458
+ # smoo:install runs `bun install` (and `uv sync` for a uv project) through
459
+ # setup-environment.ts when anything they read changed: execIfModified keys
460
+ # each file by content hash, by its path relative to tooling/direnv (so a
461
+ # copy-on-write clone at another path is unchanged), honouring .gitignore.
462
+ # The globs over-match (a fixture's package.json), which costs a no-op
463
+ # install. node_modules/.smoo-install is the stamp a successful install
464
+ # writes; named literally it is checked although node_modules is ignored, so
465
+ # deleting node_modules reinstalls. The script keeps its own per-installer
466
+ # digest under the install lock, so two shells entering at once install once.
467
+ # The scripts themselves are inputs: a new setup-environment.ts reruns.
468
+ #
469
+ # smoo:cargo-fetch establishes what the Nx plugin's offline `cargo metadata
470
+ # --locked` needs: every Cargo workspace's locked packages in CARGO_HOME. Its
471
+ # stamps live in smoo's user cache and count only while CARGO_HOME names the
472
+ # directory they were fetched into, which differs per host and per sandbox
473
+ # and no checkout path can name, so it is gated by `status` (exit 0 when
474
+ # CARGO_HOME holds them) rather than execIfModified.
475
+ #
476
+ # smoo:developer-links points the packages the root package.json's
477
+ # `smoo.developerLinks` declares at their local checkouts, after an install
478
+ # and in every tree that installed them (tooling/direnv/developer-links.ts).
479
+ # Gated by `status` too: a clone or an install can lose a link without any
480
+ # file devenv watches changing. Stale install links, including external Nx
481
+ # aliases, run the managed Bun installer before declarations are applied.
482
+ # A runner links nothing.
483
+ #
484
+ # A failed task does not fail shell entry (devenv reports it and the shell
485
+ # still loads, so the tools to repair it stay available). CI runs both with
486
+ # `devenv tasks run`, which does fail; setup-environment.ts is strict there.
487
+ tasks = let
488
+ setup = ''bun "$DEVENV_ROOT/setup-environment.ts"'';
489
+ in {
490
+ "smoo:install" = {
491
+ description = "bun install / uv sync when what they read changed";
492
+ exec = setup + lib.optionalString uvProject " --python ${python.package.interpreter}";
493
+ execIfModified = [
494
+ "../../package.json"
495
+ "../../bun.lock"
496
+ "../../bun.lockb"
497
+ "../../bunfig.toml"
498
+ "../../**/package.json"
499
+ "../../**/*.patch"
500
+ "../../pyproject.toml"
501
+ "../../uv.lock"
502
+ "../../**/pyproject.toml"
503
+ "../../tooling/workspace.gitconfig"
504
+ "setup-environment.ts"
505
+ "developer-links.ts"
506
+ "linked-snapshots.ts"
507
+ "secret-references.ts"
508
+ "../../node_modules/.smoo-install"
509
+ "../../node_modules/@typescript/native/bin/tsc"
510
+ ];
511
+ before = ["devenv:enterShell"];
512
+ showOutput = true;
513
+ };
514
+ "smoo:cargo-fetch" = {
515
+ description = "cargo fetch --locked into CARGO_HOME for each Cargo workspace";
516
+ exec = "${setup} --cargo";
517
+ status = "${setup} --cargo --check";
518
+ before = ["devenv:enterShell"];
519
+ showOutput = true;
520
+ };
521
+ "smoo:developer-links" = {
522
+ description = "repair stale install links and link declared local checkouts";
523
+ exec = "${setup} --links";
524
+ status = "${setup} --links --check";
525
+ after = ["smoo:install"];
526
+ before = ["devenv:enterShell"];
527
+ showOutput = true;
528
+ };
529
+ };
285
530
 
286
531
  enterShell = lib.mkMerge [
287
532
  # Prologue, in order:
@@ -289,17 +534,25 @@ in {
289
534
  # 1. The devenv wrapper runs from tooling/direnv; every later step expects the
290
535
  # workspace root.
291
536
  # 2. PATH order is most-specific → least-specific, the same list the git hooks
292
- # use, so a hook and a shell resolve one binary the same way.
537
+ # use, so a hook and a shell resolve one binary the same way. The Rust
538
+ # toolchain's store bin then goes ahead of all of it (rustToolchainBin
539
+ # above): the same files the profile links, named by a path no checkout
540
+ # owns. Ahead of even that goes the installed cowshed's bin, whose
541
+ # `cargo` link is the jobserver launcher, so the budget reaches builds
542
+ # no Nx executor started.
293
543
  # 3. ttsc drives the native TypeScript 7 binary while Nx imports the TypeScript
294
544
  # 6 API, so the two must be named separately.
295
- # 4. Go and ttsc caches: tooling/direnv/shared-caches.sh places them under
296
- # the machine's shared caches root when it exists and states why.
297
- # 5. The shared setup-environment.ts bootstraps repository dependencies. It
298
- # runs `bun install` — and, for a uv project, `uv sync` — only when that
299
- # installer's inputs changed since its last successful run, so an
300
- # unchanged checkout enters in the time it takes to hash a lockfile. It
301
- # records those inputs, and the managed .envrc watches them, so a shell
302
- # that direnv keeps loaded re-enters exactly when one of them changes.
545
+ # 4. ttsc caches in the checkout's .cache/ttsc (the path the CI ttsc-plugin
546
+ # cache restores), its Go build cache in a directory of its own so
547
+ # `ttsc clean` can reclaim it: ttsc never deletes a GOCACHE it did not
548
+ # resolve itself, and sharing GOCACHE once left 35G nothing could empty.
549
+ # GOFLAGS carries -trimpath, Go's stable way to keep absolute build paths
550
+ # out of an artifact. A value the caller exported wins for each. Where Go
551
+ # and the machine-wide caches live otherwise is the host's or the
552
+ # sandbox's business, not this shell's.
553
+ # 5. Dependencies are installed by the smoo:install and smoo:cargo-fetch
554
+ # tasks above, which devenv runs before this prologue; the prologue only
555
+ # activates what they installed.
303
556
  #
304
557
  # The uv project environment is devenv's UV_PROJECT_ENVIRONMENT, synced
305
558
  # with the interpreter devenv would use and activated here after the
@@ -354,45 +607,26 @@ in {
354
607
  # resolves its own GOROOT from its own binary, which makes "whose Go is
355
608
  # whose" a property of which binary is invoked — the only thing that can
356
609
  # actually be reasoned about.
357
- # 8. On Darwin, drop nix CC/CXX so xcodebuild finds Xcode's clang (it supports
358
- # -index-store-path); bun/node native addons find compilers through
359
- # node-gyp. CC/CXX are what xcodebuild reads, which is why they go rather
360
- # than being pointed somewhere else.
361
- #
362
- # The Apple SDK is the same boundary, and dropping CC/CXX alone does not
363
- # hold it. An outer nix stdenv exports SDKROOT and DEVELOPER_DIR pointing
364
- # at nixpkgs' RECONSTRUCTED apple-sdk, so Xcode's own clang goes on to
365
- # compile against that sysroot. It is not a substitute for the licensed
366
- # SDK: apple-sdk-14.4 carries usr/include and the frameworks but NO libc++
367
- # whatsoever — no usr/include/c++/v1 and no usr/lib/libc++* — so any C++
368
- # build script that resolves the SDK by name dies at `ld: library 'c++'
369
- # not found`, which a CMake `*-sys` crate reaches before compiling a line
370
- # of the project. DEVELOPER_DIR is the half that hides: `xcrun
371
- # --show-sdk-path` honours it, so even code that correctly asks xcrun for
372
- # the SDK is handed the nix one, while `xcrun --find clang` and
373
- # `xcodebuild -version` keep reporting Xcode and look healthy. It also
374
- # defeats any later guard that unsets a nix SDKROOT and then re-resolves
375
- # it through xcrun, because xcrun answers with the same tree again.
376
- #
377
- # Only a /nix/store value is dropped. An SDKROOT the operator exported
378
- # deliberately — the documented way to link Darwin from a Linux host — is
379
- # left exactly as given. Each drop is announced, so a shell never silently
380
- # swaps the SDK a build was compiled against.
381
- # Nx's fallback includes HOME or TMPDIR, either of which can exceed the
382
- # Unix socket limit in a checkout. Reuse devenv's short runtime directory,
383
- # which is keyed on this checkout's devenv root and so is one per
384
- # workspace. Unconditionally: an inherited value is another workspace's
385
- # shell (a shed entered from the host, a second repository from the first,
386
- # a subprocess of either), and one socket dir for two workspaces makes the
387
- # daemon refuse whichever came second ("received a message from a
388
- # different workspace"). Nobody supplies this deliberately.
389
- #
390
- # In a cowshed sandbox an inherited private .devenv can supply the
391
- # evaluated shell after its inputs and task graph are checked. The merged
392
- # hook still runs only when direnv imports the workspace's own export.
610
+ # 8. On Darwin, Xcode answers for the Apple toolchain: nix CC/CXX, a
611
+ # nix-store SDKROOT and DEVELOPER_DIR, and every store PATH entry carrying
612
+ # nixpkgs xcbuild's `xcrun` are dropped, each one announced, so Xcode's
613
+ # clang compiles against the licensed SDK and `xcrun` is Apple's.
614
+ # tooling/direnv/apple-developer.sh does it and states why.
615
+ # Nx's own socket fallback (under HOME or TMPDIR) can exceed the Unix socket
616
+ # limit in a checkout, and an inherited NX_SOCKET_DIR may be another
617
+ # workspace's: tooling/direnv/nx-socket-dir.sh, sourced below, names this
618
+ # workspace's own, and binds NX_WORKSPACE_ROOT_PATH, which the smoo Nx
619
+ # wrappers read to decide whether inherited Nx overrides belong to the root
620
+ # they run.
393
621
  (lib.mkBefore ''
394
622
  cd "$DEVENV_ROOT/../.."
623
+ # Direct `devenv shell` skips .envrc. Reuse cowshed's one environment writer
624
+ # before project hooks, rather than restating its CI/compiler-cache policy.
625
+ if [ -f .cowshed/env ]; then
626
+ . "$PWD/.cowshed/env"
627
+ fi
395
628
  export PATH="$("$PWD/tooling/direnv/repo-path")"
629
+ export PATH="${rustToolchainBin}:$PATH"
396
630
  # devenv enters the shell with TMPDIR unset (not empty) on every platform.
397
631
  # Tools then fall back to /tmp, which on Darwin is not the per-user
398
632
  # temporary directory the OS hands out, and a test that asserts the
@@ -402,47 +636,34 @@ in {
402
636
  TMPDIR="$(getconf DARWIN_USER_TEMP_DIR 2>/dev/null || true)"
403
637
  export TMPDIR="''${TMPDIR:-/tmp}"
404
638
  fi
405
- export TTSC_TSGO_BINARY="$PWD/node_modules/@typescript/native/bin/tsc"
406
- . "$DEVENV_ROOT/shared-caches.sh" /private/cowshed/caches
639
+ # ttsc's compiler and caches: tooling/direnv/ttsc-env.sh, shared with the
640
+ # git hooks, which run outside this shell. It reads the inherited
641
+ # NX_WORKSPACE_ROOT_PATH, so it runs before nx-socket-dir.sh rebinds it.
642
+ . "$DEVENV_ROOT/ttsc-env.sh"
643
+ export GOFLAGS="''${GOFLAGS:--trimpath}"
407
644
  unset GOROOT
408
- bun "$DEVENV_ROOT/setup-environment.ts"${lib.optionalString uvProject " --python ${python.package.interpreter}"} || exit $?
409
645
  ${lib.optionalString uvProject ''
410
646
  if [ -f pyproject.toml ]; then
411
647
  export VIRTUAL_ENV="$UV_PROJECT_ENVIRONMENT"
412
648
  export PATH="$VIRTUAL_ENV/bin:$PATH"
413
649
  fi
414
650
  ''}
415
- # One socket dir per Nx workspace. DEVENV_RUNTIME is keyed to the devenv
416
- # ROOT, so every workspace sharing one devenv - a sibling repository, a
417
- # copy-on-write clone, a scratch workspace created inside this shell -
418
- # would land on one socket. The first daemon to claim it then refuses
419
- # every message from the others ("received a message from a different
420
- # workspace"), which reads as a hung Nx in a workspace that did nothing
421
- # wrong. Nx's own diagnostic names this exact cause.
422
- nx_workspace_root="$(cd "$DEVENV_ROOT/../.." >/dev/null 2>&1 && pwd || printf '%s' "$PWD")"
423
- export NX_WORKSPACE_ROOT_PATH="$nx_workspace_root"
424
- export NX_SOCKET_DIR="$DEVENV_RUNTIME/nx-$(printf '%s' "$nx_workspace_root" | cksum | cut -d' ' -f1)"
425
- mkdir -p "$NX_SOCKET_DIR"
651
+ # Nx's workspace root and socket dir: tooling/direnv/nx-socket-dir.sh
652
+ # gives every workspace its own socket dir, and in a cowshed checkout the
653
+ # one literal path its host shells and sandboxed jobs all share, and
654
+ # states why.
655
+ . "$DEVENV_ROOT/nx-socket-dir.sh"
426
656
  ${lib.optionalString pkgs.stdenv.isDarwin ''
427
- unset CC CXX
428
- case "''${SDKROOT:-}" in
429
- /nix/store/*)
430
- echo "devenv: dropping nix-store SDKROOT ($SDKROOT); Xcode holds the licensed macOS SDK" >&2
431
- unset SDKROOT NIX_APPLE_SDK_VERSION
432
- ;;
433
- esac
434
- case "''${DEVELOPER_DIR:-}" in
435
- /nix/store/*)
436
- echo "devenv: dropping nix-store DEVELOPER_DIR ($DEVELOPER_DIR); xcrun must answer from Xcode" >&2
437
- unset DEVELOPER_DIR NIX_APPLE_SDK_VERSION
438
- ;;
439
- esac
657
+ . "$DEVENV_ROOT/apple-developer.sh" /nix/store
440
658
  ''}
441
659
  '')
442
660
  # Epilogue, after every project step (a project's own enterShell may resolve
443
661
  # SDKROOT/compilers; the toolchain identity must see the final values). The
444
662
  # stamp logic lives in toolchain-stamp.ts; see its header for why.
445
663
  (lib.mkAfter ''
664
+ # Project hooks may prepend real Cargo. Reuse the managed PATH writer
665
+ # last: its served install identity is the host's, not the private HOME.
666
+ export PATH="$("$DEVENV_ROOT/repo-path")"
446
667
  bun "$DEVENV_ROOT/toolchain-stamp.ts" || exit $?
447
668
  if [ -n "$DEVENV_SHELL_PWD" ]; then
448
669
  cd "$DEVENV_SHELL_PWD"
@@ -77,22 +77,28 @@ install_devenv() {
77
77
  # `nix profile remove --all` on a host would take the fleet's other roots with
78
78
  # it. SMOO_HOST_RUNNER comes from setup-devenv's runner-kind detection.
79
79
  #
80
- # With none present these runners install from the FLOATING branch, not the
81
- # locked rev, which is the one place this script deliberately accepts drift.
82
- # The pin exists to make the ephemeral runners' cached devenv reproducible;
83
- # a host installs into a long-lived shared profile whose blast radius is the
84
- # whole fleet, and pinning it down to an older CLI than the fleet had been
85
- # running broke it: run 34374650577 segfaulted the Rust linker
80
+ # With none present these runners install a devenv RELEASE, not the locked
81
+ # rev. The lock pin exists to make the ephemeral runners' cached devenv
82
+ # reproducible; a host installs into a long-lived shared profile whose blast
83
+ # radius is the whole fleet, and pinning it down to an older CLI than the
84
+ # fleet had been running broke it: run 34374650577 segfaulted the Rust linker
86
85
  # (devenv-rust-linker, clang exit 139) building cowshed-cli tests, where run
87
86
  # 34371205556 on the same commit range was green with floating 2a399e9.
88
87
  # 190959a is TWO COMMITS OLDER than what these hosts had been getting, so the
89
- # pin was moving them backwards. A host's toolchain moves when its image or
90
- # the lock moves, not when a repository decides to hold it back.
88
+ # pin was moving them backwards.
89
+ #
90
+ # Floating `github:cachix/devenv` (devenv's main) was no better: on
91
+ # 2026-10-16 main moved to a nix 2.35.2 that devenv.cachix.org does not
92
+ # serve, every host compiled 65 derivations, and nix-store-2.35.2 failed to
93
+ # build — CI went red fleet-wide with no commit here to bisect. A release
94
+ # tag fixes both: devenv.cachix.org pins every release from v2.0.4 on for
95
+ # good, so it always substitutes, and it moves only when this line does.
96
+ # Keep it at or above what the consuming locks name.
91
97
  if [ "${SMOO_HOST_RUNNER:-false}" = true ]; then
92
98
  if command -v devenv >/dev/null 2>&1; then
93
99
  echo "using host devenv: $(command -v devenv) ($(devenv version))"
94
100
  else
95
- flake="${DEVENV_FLAKE:-github:cachix/devenv}"
101
+ flake="${DEVENV_FLAKE:-github:cachix/devenv/v2.4.0}"
96
102
  echo "host runner has no devenv; nix profile add ${flake}"
97
103
  nix profile add --accept-flake-config "$flake"
98
104
  fi
@@ -142,8 +148,11 @@ devenv_path_and_caches() {
142
148
  build_devenv_shell() {
143
149
  local since
144
150
  since="$(date +%s)"
145
- # One evaluation: the shell that captures the environment is the shell
146
- # build. A separate `devenv shell -- date` evaluated everything twice.
151
+ # The installs are devenv tasks, and a failed task does not fail
152
+ # `devenv shell`; `devenv tasks run` does, so CI runs them first and the
153
+ # shell capture below then finds them current. Its evaluation is the one
154
+ # the capture reuses from devenv's eval cache.
155
+ devenv tasks run smoo:install smoo:cargo-fetch
147
156
  persist_devenv_environment
148
157
  # Only the ephemeral-runner path of setup-devenv opts in: the scan walks the
149
158
  # whole store, which on a developer host or a host runner is large and not