Skip to content

ci: build inside a nix develop shell with just#19

Merged
tembleking merged 4 commits into
mainfrom
nix-devshell-ci
Jun 18, 2026
Merged

ci: build inside a nix develop shell with just#19
tembleking merged 4 commits into
mainfrom
nix-devshell-ci

Conversation

@tembleking

Copy link
Copy Markdown
Member

Pin the CI toolchain in a flake devShell so CI and local builds share one reproducible environment instead of installing tools ad-hoc. Workflows now install Nix and use nix develop --command bash as the default shell.

Migrate Makefile -> justfile (just replaces gnumake in the shell). just update bumps the flake inputs, tfx-cli, and re-pins actions; actions are pinned to SHAs via pinact (just pin-actions). node_20 is EOL in nixpkgs -> devShell uses node_22; azure/login bumped to v3.

Pin the toolchain (node, typescript, tfx-cli, azure-cli, jq, pinact) in a
flake devShell so CI and local builds share one reproducible environment
instead of installing tools ad-hoc. tfx-cli is not in nixpkgs, so build it
from upstream Microsoft/tfs-cli in nix/tfx-cli.nix.

Workflows now install Nix and use `nix develop --command bash` as the default
shell, dropping the manual node setup and `npm install -g` steps. Actions are
pinned to commit SHAs via `make pin-actions` (pinact).
Use just as the command runner; add it to the devShell (replacing gnumake)
and update workflows to call just build / just publish-release.
Add curl/sd to the devShell and expose packages.tfx-cli. `just update`
runs flake update, bumps tfx-cli to the latest upstream commit with
recomputed hashes (update-tfx/rehash-tfx), and re-pins actions, each step
wrapped in `nix develop --command` so it runs from a bare shell.
@tembleking tembleking enabled auto-merge (squash) June 18, 2026 09:18

@airadier airadier left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, well-scoped infra migration (Makefile → justfile, tools pinned in a Nix devShell, workflows running under nix develop). I verified flake.nix is well-formed — the // { overlay merge is present, so no syntax issue there.

One blocking item and a few non-blocking recommendations, left as inline comments.

🔴 Blocking — please change:

  1. .envrc instructs developers to put env vars and act secrets (Azure tokens) in .env/.secrets, but neither file is in .gitignore. Since the workflows themselves git add ., this is a real path to committing live credentials. One-line fix.

🟡 Non-blocking, but recommended:
2. azure/login authenticates the runner's az, while the token step now runs under nix develop with the nixpkgs az — a version skew that could break token retrieval / release.
3. rehash-tfx can silently leave an empty hash on failure.
4. magic-nix-cache-action is deprecated/sunset by Determinate Systems — worth confirming it still caches.

Everything else (nixpkgs-unstable + just update reproducibility, the unused token output in the PR check) is fine / pre-existing.

Comment thread .gitignore
Comment thread .github/workflows/main.yml
Comment thread .github/workflows/main.yml
Comment thread justfile Outdated
- gitignore .env/.secrets so the .envrc-suggested secret files can't be
  committed by the workflows' git add .
- pin the token-retrieval steps to the runner's az (shell: bash) so the
  binary that reads ~/.azure matches the one azure/login wrote it with
- fail loudly in rehash-tfx instead of leaving an empty hash on parse error
@tembleking tembleking merged commit b65dc17 into main Jun 18, 2026
4 checks passed
@tembleking tembleking deleted the nix-devshell-ci branch June 18, 2026 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants