Commit bd4920f
ci(nix): Replace standalone package.nix with flake.nix (#508)
## Summary
Adds Nix flake support for consuming `infer` from any flake-aware tool —
most notably as a Flox manifest entry across other repos. Replaces the
standalone `nix/package.nix` with a single `flake.nix` at the repo root,
and syncs `version` + `vendorHash` as part of each release commit so
tags are self-consistent.
### Pin from Flox
```toml
[install]
infer.flake = "github:inference-gateway/cli/v0.110.0" # recommended: pin to tag
infer.flake = "github:inference-gateway/cli" # latest default branch
```
Tag pins are the reliable path — the release commit refreshes both
`version =` and `vendorHash`, so every tagged version builds cleanly in
a fresh checkout.
### Changes
1. **NEW `flake.nix`** — multi-platform (`aarch64`/`x86_64` ×
`linux`/`darwin`) `buildGoModule` derivation. `proxyVendor = true`
(still required by `robotgo`'s CGO header layout) and `goSum =
./go.sum;` for reliability across nixpkgs upgrades. Exposes
`packages.<system>.{default,infer}`, `apps.default`, and
`devShells.default`.
2. **DELETED `nix/` folder** — `package.nix`, `default.nix`,
`update-hashes.sh`, and the `nixpkgs-submission/` scaffolding. Single
source of truth.
3. **MIGRATED `nix-build.yml`** — switched from `nix-build` to `nix
build .#infer` + `nix flake check --all-systems`. Only triggers on
`flake.nix`/`flake.lock` changes.
4. **UPDATED `release.yml` + `.releaserc.yaml`** — added Determinate Nix
install + `@semantic-release/exec` with a `prepareCmd` that:
- seds `version =` in `flake.nix`
- runs `determinate-nixd fix hashes --auto-apply flake.nix` to refresh
`vendorHash`
- `flake.nix` is committed alongside `CHANGELOG.md` via
`@semantic-release/git`'s `assets`
5. **DELETED `nix-version-sync.yml`** — its job is now done inside the
release commit itself, not in a follow-up PR.
### Release pipeline impact
~30-60s for Determinate Nix install + a few seconds for `fix hashes` per
release. Subsequent releases are mostly cached.
### Mid-cycle staleness (known trade-off)
Between releases, `main` may have stale `vendorHash` if Dependabot
bumped `go.mod`/`go.sum`. `nix build github:inference-gateway/cli`
(default branch) may fail during these windows. Each release pipeline
refreshes it. **Pin to tags for reliability** — this is the recommended
consumption pattern for cross-repo Flox manifests anyway.
## Test plan
- [x] `nix flake check --all-systems --no-build` evaluates cleanly on
all 4 platforms
- [x] `nix build .#infer` succeeds locally → `result/bin/infer version`
reports `0.109.3`
- [x] `nixfmt --check flake.nix` + `statix check flake.nix` pass
- [x] **Flox integration A** (local `path:` ref): `flox activate --
infer version` works against working tree
- [x] **Flox integration B** (remote `github:` ref): `flox activate --
infer version` works against this pushed branch
- [ ] CI `Nix Build Verification` matrix passes on all 4 platforms
- [ ] First release after merge: confirm release commit includes both
`CHANGELOG.md` and `flake.nix` updates, and `nix build
github:inference-gateway/cli/v<new>#infer` succeeds in a clean checkout
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent aabde54 commit bd4920f
6 files changed
Lines changed: 245 additions & 160 deletions
File tree
- .github/workflows
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | | - | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
18 | | - | |
| 20 | + | |
| 21 | + | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
| |||
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
56 | | - | |
| 59 | + | |
57 | 60 | | |
58 | 61 | | |
59 | 62 | | |
| |||
93 | 96 | | |
94 | 97 | | |
95 | 98 | | |
96 | | - | |
| 99 | + | |
97 | 100 | | |
98 | 101 | | |
99 | 102 | | |
100 | | - | |
| 103 | + | |
101 | 104 | | |
102 | | - | |
| 105 | + | |
103 | 106 | | |
104 | | - | |
| 107 | + | |
105 | 108 | | |
106 | 109 | | |
107 | 110 | | |
| |||
124 | 127 | | |
125 | 128 | | |
126 | 129 | | |
127 | | - | |
| 130 | + | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
73 | 77 | | |
74 | 78 | | |
75 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
90 | 95 | | |
91 | 96 | | |
92 | 97 | | |
| 98 | + | |
93 | 99 | | |
94 | 100 | | |
95 | 101 | | |
| |||
124 | 130 | | |
125 | 131 | | |
126 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
127 | 148 | | |
128 | 149 | | |
129 | 150 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments