`nix build .#punktfunk-web` has been broken since1e9957d9re-resolved web/bun.lock: the console's node_modules came from a fixed-output derivation whose single aggregate `outputHash` was last refreshed in4094f620, so every lockfile change silently invalidated it and the fix required a round-trip on a Linux nix box (build, read the `got:` hash, paste it back). The runner (sdk/bun.lock) had the same latent trap. Replace both FODs with bun2nix (github:nix-community/bun2nix, pinned to 2.1.2). `fetchBunDeps` turns a generated, committed `bun.nix` into bun's global install cache — ONE `fetchurl` per package, keyed by the integrity hash already in the lockfile — and the setup hook then runs a fully offline `bun install` in `bunRoot`. There is no aggregate hash left to go stale. The `@unom` scope needs no special handling: bun.lock records those tarballs' full git.unom.io URLs and the registry is read-public. `bun.nix` keeps itself in step: `bun2nix` is now a devDependency of both packages and regenerates the file on every `bun install` — web via `postinstall`, the SDK via `prepare`, because sdk/ is the published @punktfunk/host package and a postinstall would fire on consumers' installs. Both the flake input and the npm devDependency are pinned to the same exact version; `bun.nix` has no schema stability guarantee across bun2nix releases, so they move together (README documents this). Dropped along the way: the manual `cp -R ${deps}/node_modules` + `chmod -R u+w` + `patchShebangs web/node_modules` dance, since bun2nix patches shebangs inside the cache. `dontUseBunPatch` keeps the hook from running `patchShebangs .` over the whole repo checkout (it would rewrite scripts/web-init.sh, which we ship verbatim); `dontRunLifecycleScripts` preserves the old `--ignore-scripts` behaviour, so playwright still never tries to download browsers. Verified on a Linux nix box (Determinate Nix 3.21.5): `.#punktfunk-web` and `.#punktfunk-scripting` both build green, offline; the i18n guard reports its 421 compiled messages, the `Bun.serve` bundle guard passes, and `nix run .#punktfunk-scripting -- --list` discovers an installed plugin. `nix flake show --all-systems` evaluates every output. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> (cherry picked from commit 4cfe7f05ee608868857be9e7eec079044448a965)
147 lines
3.6 KiB
JSON
147 lines
3.6 KiB
JSON
{
|
|
"nodes": {
|
|
"bun2nix": {
|
|
"inputs": {
|
|
"flake-parts": "flake-parts",
|
|
"nixpkgs": [
|
|
"nixpkgs"
|
|
],
|
|
"systems": "systems",
|
|
"treefmt-nix": "treefmt-nix"
|
|
},
|
|
"locked": {
|
|
"lastModified": 1784665499,
|
|
"narHash": "sha256-9BMxlTxCCDAeoNLtb1a/st7udtTIJep+wpUzquA29VU=",
|
|
"owner": "nix-community",
|
|
"repo": "bun2nix",
|
|
"rev": "0f2a1f0b6f42cebe3b149bf62d38754c5e0e9729",
|
|
"type": "github"
|
|
},
|
|
"original": {
|
|
"owner": "nix-community",
|
|
"ref": "2.1.2",
|
|
"repo": "bun2nix",
|
|
"type": "github"
|
|
}
|
|
},
|
|
"crane": {
|
|
"locked": {
|
|
"lastModified": 1784172867,
|
|
"narHash": "sha256-hzzeOgTP0MXMvg4djVwysTDvvUXIpsUCgsA0wPMF/Qk=",
|
|
"owner": "ipetkov",
|
|
"repo": "crane",
|
|
"rev": "8833b7dc3c7426ce1110ed6fed31b6f63d74f2dc",
|
|
"type": "github"
|
|
},
|
|
"original": {
|
|
"owner": "ipetkov",
|
|
"repo": "crane",
|
|
"type": "github"
|
|
}
|
|
},
|
|
"flake-parts": {
|
|
"inputs": {
|
|
"nixpkgs-lib": [
|
|
"bun2nix",
|
|
"nixpkgs"
|
|
]
|
|
},
|
|
"locked": {
|
|
"lastModified": 1782949081,
|
|
"narHash": "sha256-vp6Y/Grm98ESt6ceOkWiHWyZRDV3J1RID4w+6NWK9yA=",
|
|
"owner": "hercules-ci",
|
|
"repo": "flake-parts",
|
|
"rev": "17c9d6cdfc60c64f4ee8d306f9bc0b4ccb51481e",
|
|
"type": "github"
|
|
},
|
|
"original": {
|
|
"owner": "hercules-ci",
|
|
"repo": "flake-parts",
|
|
"type": "github"
|
|
}
|
|
},
|
|
"nixpkgs": {
|
|
"locked": {
|
|
"lastModified": 1784120854,
|
|
"narHash": "sha256-KesHgItiZPgGX740axSiQLcIQ8D24MDqNpkKYWIek8k=",
|
|
"owner": "NixOS",
|
|
"repo": "nixpkgs",
|
|
"rev": "753cc8a3a87467296ddd1fa93f0cc3e81120ee46",
|
|
"type": "github"
|
|
},
|
|
"original": {
|
|
"owner": "NixOS",
|
|
"ref": "nixos-unstable",
|
|
"repo": "nixpkgs",
|
|
"type": "github"
|
|
}
|
|
},
|
|
"root": {
|
|
"inputs": {
|
|
"bun2nix": "bun2nix",
|
|
"crane": "crane",
|
|
"nixpkgs": "nixpkgs",
|
|
"rust-overlay": "rust-overlay"
|
|
}
|
|
},
|
|
"rust-overlay": {
|
|
"inputs": {
|
|
"nixpkgs": [
|
|
"nixpkgs"
|
|
]
|
|
},
|
|
"locked": {
|
|
"lastModified": 1784178955,
|
|
"narHash": "sha256-YtXHVFBzzqSidcEhPhfTcF2yzzu0p0yA7x07LOR+LaY=",
|
|
"owner": "oxalica",
|
|
"repo": "rust-overlay",
|
|
"rev": "1785b85aeccca381caf8777133410f577b8f2f59",
|
|
"type": "github"
|
|
},
|
|
"original": {
|
|
"owner": "oxalica",
|
|
"repo": "rust-overlay",
|
|
"type": "github"
|
|
}
|
|
},
|
|
"systems": {
|
|
"locked": {
|
|
"lastModified": 1776166891,
|
|
"narHash": "sha256-bI8yrEGjrohR5hkQox7UrxDH7XqrYMwI8SL/LrJ1+S8=",
|
|
"owner": "nix-systems",
|
|
"repo": "triplet",
|
|
"rev": "6de7bc09397911ce03636afbcf6118745ab2cda0",
|
|
"type": "github"
|
|
},
|
|
"original": {
|
|
"owner": "nix-systems",
|
|
"repo": "triplet",
|
|
"type": "github"
|
|
}
|
|
},
|
|
"treefmt-nix": {
|
|
"inputs": {
|
|
"nixpkgs": [
|
|
"bun2nix",
|
|
"nixpkgs"
|
|
]
|
|
},
|
|
"locked": {
|
|
"lastModified": 1784369104,
|
|
"narHash": "sha256-47cxbcZODibHv3rELFQ9vZly0vUNkND/atn/U7HLeb0=",
|
|
"owner": "numtide",
|
|
"repo": "treefmt-nix",
|
|
"rev": "df3c0640565d04a0261253cdd89fce78ec50168a",
|
|
"type": "github"
|
|
},
|
|
"original": {
|
|
"owner": "numtide",
|
|
"repo": "treefmt-nix",
|
|
"type": "github"
|
|
}
|
|
}
|
|
},
|
|
"root": "root",
|
|
"version": 7
|
|
}
|