From dfe87240b09331e09d42efdde176bc3a0daaedbc Mon Sep 17 00:00:00 2001 From: dev-null-undefined Date: Tue, 13 Oct 2026 13:07:36 +0200 Subject: [PATCH] Nix: evaluate the flake in CI so a new git dependency can't break nix build / nix develop again Since UI.9 (9bfabc98) Cargo.lock has a git source, craft-ui from storytold/craft-libs. importCargoLock needs a hash for every git dependency, so evaluation stopped with "No hash was found while vendoring the git dependency craft-ui-0.1.0" and both `nix build` and `nix develop` failed on NixOS for two days (#1314 fixed it with cargoLock.allowBuiltinFetchGit). The flake is not built in CI, so nothing noticed: the new Nix workflow runs `nix flake check --no-build --all-systems` whenever flake.nix, flake.lock, nix/ or Cargo.lock change. Co-Authored-By: Claude --- .github/workflows/nix.yml | 28 ++++++++++++++++++++++++++++ AGENTS.md | 4 ++-- CLAUDE.md | 4 ++-- 3 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/nix.yml diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml new file mode 100644 index 000000000..d992f7433 --- /dev/null +++ b/.github/workflows/nix.yml @@ -0,0 +1,28 @@ +# Evaluates the Nix flake (no build, about a minute): `nix build` / `nix develop` stop at evaluation +# when Cargo.lock gains something nix/package.nix can't vendor, and nothing else would notice. +name: Nix + +on: + push: + branches: [main] + paths: ["flake.nix", "flake.lock", "nix/**", "Cargo.lock", ".github/workflows/nix.yml"] + pull_request: + paths: ["flake.nix", "flake.lock", "nix/**", "Cargo.lock", ".github/workflows/nix.yml"] + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: nix-${{ github.ref }} + cancel-in-progress: true + +jobs: + eval: + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: cachix/install-nix-action@13d8dd58da0234aa297dedd986986ccb8e7f3e24 # v31.11.1 + - name: nix flake check --no-build + run: nix flake check --no-build --all-systems diff --git a/AGENTS.md b/AGENTS.md index 8cd199ff6..297682755 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -131,8 +131,8 @@ of it. Full standard: `../craftrules/standards/never-crash.md` → `ui-egui`, `mcp` (L5) → apps `lightcraft` (desktop), `lightcraft-cli` (render/commands/MCP). `scenes` generates demo photos. `xtask` = tooling (`ci`, `layers`, `assets`, `parity`, `wasm`, `corpus`, `stats`). `flake.nix` + `nix/package.nix` = the Nix package (`nix build` builds both binaries with the craft-fonts input, installs the -desktop file/icons/AppStream metadata and runs `cargo test --workspace`; `nix develop` = dev shell). Community-maintained and not -in CI: it may lag behind the workspace; see README → Quick start. +desktop file/icons/AppStream metadata and runs `cargo test --workspace`; `nix develop` = dev shell). Community-maintained; CI only +evaluates it (`.github/workflows/nix.yml`), so the build may lag behind the workspace; see README → Quick start. ## Contributor credits (About window) diff --git a/CLAUDE.md b/CLAUDE.md index 4a736f12a..6099b1d2f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -138,5 +138,5 @@ of it. Full standard: `../craftrules/standards/never-crash.md` → `ui-egui`, `mcp` (L5) → apps `lightcraft` (desktop), `lightcraft-cli` (render/commands/MCP). `scenes` generates demo photos. `xtask` = tooling (`ci`, `layers`, `assets`, `parity`, `wasm`, `corpus`, `stats`). `flake.nix` + `nix/package.nix` = the Nix package (`nix build` builds both binaries with the craft-fonts input, installs the -desktop file/icons/AppStream metadata and runs `cargo test --workspace`; `nix develop` = dev shell). Community-maintained and not -in CI: it may lag behind the workspace; see README → Quick start. +desktop file/icons/AppStream metadata and runs `cargo test --workspace`; `nix develop` = dev shell). Community-maintained; CI only +evaluates it (`.github/workflows/nix.yml`), so the build may lag behind the workspace; see README → Quick start.