Skip to content

Commit ae0a921

Browse files
authored
fix(devenv-image): take devenv 2.4.0 from a pinned nixos-unstable rev (#550)
## Summary The devenv image now installs devenv 2.4.0 from a pinned `nixos-unstable` rev (`DEVENV_NIXPKGS_REV`), while direnv stays on the existing nixos-26.05 pin (`NIXPKGS_REV`). This fixes devenv 2.1.2 ignoring the signing keys of a repo's `cachix.pull` caches, which forces source builds that sandbox egress blocks. `VERSION` goes to `2.1.0`. ## Eligibility & Accountability - [x] I am a **federal employee or contractor** (PRs merge with `@GSA-TTS/agentic-coding-team` code-owner approval; eligibility is attested here, not authenticated). *Anyone may open issues without this.* - [x] **I understand this change and can explain it in my own words** — I am the author of record and accountable for it. - [x] By opening this PR, I **attest I have the right to release this work** under the repository's [CC0-1.0](../LICENSE) dedication. ## AI Assistance Disclosure - [x] AI tools were used in this contribution - [x] I verified all AI-generated content: no fabricated/hallucinated APIs, dependencies, citations, or placeholder content; any AI-suggested dependency was confirmed to exist. - [x] Any inherited/reused third-party material retains its original license and is identified (not represented as public domain). ## Type of Change - [x] Bug fix - [x] Infrastructure/tooling change ## Motivation `devenv-shell:2.0.0` and `devenv-opencode:2.0.0` ship devenv 2.1.2, which has [cachix/devenv#3176](cachix/devenv#3176): it passes an empty `extra-trusted-public-keys`, so Nix ignores every substitute from `devenv.cachix.org` (the `devenv-nixpkgs/rolling` default) and other cachix caches. In a sandbox the resulting source builds fail with `403` from source mirrors that aren't on the egress allowlist; 3 of 5 login.gov repos failed this way on `2.0.0` and all build on `1.0.0`. [cachix/devenv#3178](cachix/devenv#3178) fixed it in devenv 2.3.1, but `release-26.05` still packages 2.1.2. ## Changes - `Dockerfile`: new `ARG DEVENV_NIXPKGS_REV=31ecbaca1bdefa45dffc409f0250bd8039ea0010`, used only for `#devenv`; direnv keeps `NIXPKGS_REV`. The comment records why, that both revs are signed by the `cache.nixos.org` key the image already trusts, and to drop the second pin once the stable branch packages devenv ≥ 2.3.1. - `VERSION`: `2.0.0` → `2.1.0` (devenv stays 2.x, so this is a minor bump under the image contract). - `README.md`: documents the second pin, advises against `2.0.0`, and lists `DEVENV_NIXPKGS_REV` among the toolchain changes that need a `VERSION` bump. Kits that pin tools to `NIXPKGS_REV` to share the image's closures are unaffected; only devenv's closure comes from the second rev. ## Testing - [x] Ran `make validate` locally (all checks pass) - [ ] Ran `make test` (if applicable) - [x] Tested with at least one real scenario - [x] Commit messages follow [Conventional Commits](https://www.conventionalcommits.org/) format Acceptance criteria from the issue, checked against a `workflow_dispatch` build of this branch ([run 40781422183](https://github.com/GSA-TTS/agentic-coding-patterns/actions/runs/40781422183), which built all four variant/arch images by digest without publishing tags) and an msb sandbox on the arm64 `devenv-shell` digest: - [x] `devenv version` in the image reports ≥ 2.3.1 on amd64 and arm64. arm64: `devenv 2.4.0 (aarch64-linux)` in the sandbox. amd64: the build log installs `/nix/store/yqm4mhvx…-devenv-2.4.0`; `devenv version` itself was not run on amd64. - [x] devenv is substituted from `cache.nixos.org` on both architectures (no source build in the CI log). All four jobs log `copying path '…-devenv-2.4.0' from 'https://cache.nixos.org'` and no `building` lines. - [x] In a sandbox on the new image, a repo that pulls from `devenv.cachix.org` builds its shell with no "ignoring substitute" warnings. identity-idp (which downloads many `devenv.cachix.org` NARs) and data-transformation (which uses `nixpkgs-python.cachix.org`) both build; neither of them, nor identity-devops, logs an "ignoring substitute" warning. Also verified: - `pkgs/by-name/de/devenv/package.nix` at `31ecbaca` declares `version = "2.4.0"`. - `31ecbaca` was the `nixos-unstable` branch head when this PR was opened, so it passed the Hydra channel gate. Known remaining failure, separate from this fix and not a regression: identity-devops fails on arm64 on both this image and `devenv-shell:1.0.0` (devenv 1.11.2), at the same `bash53-001` source fetch. Its lock pins `devenv` and `devenv-nixpkgs` commits from December 2025, and `devenv-tasks-2.0.0` and `python3-3.12.12` for aarch64-linux at those revs are in none of `cache.nixos.org`, `devenv.cachix.org` or `nixpkgs-python.cachix.org`. Building them pulls in source fetches from `ftpmirror.gnu.org`, which egress blocks. The image trusts and substitutes every path that is cached; a `devenv update` in that repo is the likely fix. ## Safety Checklist - [x] No secrets, API keys, tokens, or passwords included - [x] No PII (names, emails, SSNs, addresses) - [x] No CUI (Controlled Unclassified Information) - [x] No internal URLs, hostnames, or system paths - [x] No customer data or proprietary information ## Validation Results ``` make validate ✓ All validators passed ``` ## Related Issues Closes #549 ## Additional Context Alternatives considered in the issue: backporting devenv ≥ 2.3.1 to `release-26.05` (fixes it at the source, but the timing is outside this repo's control; worth requesting in parallel), baking cachix keys into `nix.conf` (hard-codes keys for caches that individual repos choose), and kit-side workarounds (fixes one consumer at a time).
1 parent 78154ec commit ae0a921

3 files changed

Lines changed: 23 additions & 10 deletions

File tree

‎integrations/isolation/images/devenv/Dockerfile‎

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,19 @@
55
ARG BASE_IMAGE=docker/sandbox-templates:shell-docker
66
FROM ${BASE_IMAGE}
77

8-
# devenv/direnv nixpkgs pin (nixos-26.05 → devenv 2.1.2). Bump this and
9-
# VERSION together — unpinned `nixpkgs#…` tracks unstable HEAD and drifts per
10-
# build. The devenv major is part of the image contract: a major change here
11-
# is a major VERSION bump.
8+
# nixpkgs pins. Bump these and VERSION together — unpinned `nixpkgs#…` tracks
9+
# unstable HEAD and drifts per build. The devenv major is part of the image
10+
# contract: a major change here is a major VERSION bump.
11+
#
12+
# NIXPKGS_REV (nixos-26.05) supplies direnv and is the rev kits pin to share
13+
# the image's closures. DEVENV_NIXPKGS_REV (nixos-unstable → devenv 2.4.0)
14+
# supplies devenv alone: devenv 2.0–2.3.0 stopped fetching the signing keys of
15+
# `cachix.pull` caches, so Nix rejects every substitute from them and builds
16+
# from source (fixed in 2.3.1). Both revs are Hydra-built and signed by the
17+
# cache.nixos.org key. Drop DEVENV_NIXPKGS_REV once nixos-26.05 (or the
18+
# stable branch NIXPKGS_REV moves to) packages devenv ≥ 2.3.1.
1219
ARG NIXPKGS_REV=0d9e9b832d03ac387417e16ce1febf73b2e631e1
20+
ARG DEVENV_NIXPKGS_REV=31ecbaca1bdefa45dffc409f0250bd8039ea0010
1321

1422
# Checksum pin for the installer script below (release assets are mutable);
1523
# bump together with the installer version.
@@ -75,7 +83,7 @@ RUN mkdir -p /home/agent/.config/nix \
7583

7684
RUN . /etc/profile.d/nix.sh \
7785
&& nix profile install \
78-
"github:NixOS/nixpkgs/${NIXPKGS_REV}#devenv" \
86+
"github:NixOS/nixpkgs/${DEVENV_NIXPKGS_REV}#devenv" \
7987
"github:NixOS/nixpkgs/${NIXPKGS_REV}#direnv"
8088

8189
# Nix profile + direnv hook for interactive/login bash sessions (the ENV PATH

‎integrations/isolation/images/devenv/README.md‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@ owned by `agent`), devenv + direnv pinned to a nixpkgs rev, flakes enabled,
3535
and the bash wiring that puts the Nix profile and direnv hook in every shell.
3636

3737
The devenv major is part of the image contract: `1.x` tags ship devenv 1.x
38-
(nixos-25.05), `2.x` tags ship devenv 2.x (nixos-26.05). devenv 2.x bundles
38+
(nixos-25.05), `2.x` tags ship devenv 2.x (nixos-26.05). From `2.1.0`, devenv
39+
comes from a separate nixos-unstable pin (`DEVENV_NIXPKGS_REV`, devenv 2.4.0)
40+
while direnv stays on `NIXPKGS_REV`: devenv 2.0–2.3.0 ignores the signing keys
41+
of the caches in a repo's `cachix.pull`, so every path from those caches
42+
(including `devenv.cachix.org`) is rebuilt from source, which sandbox egress
43+
usually blocks. Avoid `2.0.0` for that reason. devenv 2.x bundles
3944
its own Nix for evaluation and builds and shares the single-user store with
4045
the installer's Nix on `PATH`; both read and write the same store database.
4146

@@ -90,7 +95,7 @@ docker build --build-arg EXTRA_CA_CERT="$(cat proxy-root-ca.crt)" .
9095
## Versioning
9196

9297
[`VERSION`](VERSION) is the published tag, bumped together with any toolchain
93-
change (`NIXPKGS_REV`, installer version, base image), with a major bump when
94-
the devenv major changes; tags are never reused —
95-
the workflow refuses to republish an existing version tag. A moving `latest`
98+
change (`NIXPKGS_REV`, `DEVENV_NIXPKGS_REV`, installer version, base image),
99+
with a major bump when the devenv major changes; tags are never reused — the
100+
workflow refuses to republish an existing version tag. A moving `latest`
96101
also exists — pin the version tag in anything durable.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.0.0
1+
2.1.0

0 commit comments

Comments
 (0)