Repository navigation
fix(workflows): trust the consumer flake's nixConfig in devkit-upgrade - #1600
Merged
Merged
Conversation
The scaffolded devkit-upgrade.yml installs Nix with only experimental-features, so a consumer flake's own nixConfig substituters are ignored on both Nix legs of the job. setup-devkit-toolchain — same payload, same runner class, same flake — passes the full set. Lift that expectation into workflow_scaffold as one NIX_SETTINGS constant plus a parse_nix_settings helper, point the two existing toolchain assertions at it, and add the failing third assertion for the upgrade workflow's installer step. Refs: #1599
Install Nix with the same four settings setup-devkit-toolchain has always passed: accept-flake-config plus the vig-os Cachix substituter and its public key. Both Nix legs of the job — install.sh's `nix flake update vigos` and the `nix develop` commit — stop warning "ignoring untrusted flake configuration setting" and can substitute from the caches the consumer's own flake.nix declares. Not a #773 regression: that removed accept-flake-config from the image's baked nix.conf, where a container-run FOREIGN flake could redirect the substituters. This is per-runner, in a job that evaluates the consumer's own repo flake and nothing else. Refs: #1599
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The scaffolded
devkit-upgrade.ymlinstalled Nix with onlyexperimental-features, so a consumer repo whoseflake.nixdeclares anixConfigblock had it ignored on both Nix legs of the job —install.sh'snix flake update vigosand thenix develop -c git commit— each emittingand resolving the dev-shell against
cache.nixos.orgalone.setup-devkit-toolchain— same scaffold payload, same runner class, sameconsumer flake — has always passed the full set. This closes the gap and pins
all three copies to one constant.
Type of Change
fix-- Bug fixModifiers
!)Changes Made
assets/workspace/.github/workflows/devkit-upgrade.yml— theInstall Nixstep now carries
accept-flake-config = true,extra-substitutersandextra-trusted-public-keysalongsideexperimental-features, with a commentexplaining the [SECURITY] Harden baked nix.conf: drop accept-flake-config=true for explicit substituters + trusted-public-keys #773 boundary
tests/workflow_scaffold.py— new sharedNIX_SETTINGSconstant andparse_nix_settings()helper, so the three places that ship these settingsassert against one expectation instead of three
tests/test_workflow_devkit_upgrade.py— newtest_install_nix_carries_the_toolchain_nix_settingstests/test_setup_toolchain_env.py— its two existing assertions now use theshared constant (net −22 lines of hand-rolled parsing)
Not a #773 regression
#773 removed
accept-flake-config = truefrom the image's baked/etc/nix/nix.conf, where any in-containernix run github:attacker/flakewouldsilently trust a foreign flake's substituters.
tests/test_image.py::test_nix_conf_does_not_accept_flake_configstill guardsthat and is untouched.
This is the other case: a per-runner installer setting, in a job that evaluates
the consumer's own repo flake and nothing else — the identical posture
setup-devkit-toolchainalready ships to every consumer.Scope note
This removes two warnings per run and restores the substituters the consumer's
flake asked for. It is not a meaningful speed-up: the upgrade step advances
the consumer's
nixpkgspin immediately before thenix develop, so thatclosure is new and no cache holds it. Sized
effort:small/priority:lowaccordingly.
Changelog Entry
Testing
just test)Manual Testing Details
TDD, both phases run:
312f43af):1 failed, 42 passed— the new assertion reportedRight contains 3 more items: accept-flake-config, extra-substituters, extra-trusted-public-keys02c1a3db):70 passedacrosstest_workflow_devkit_upgrade.py+test_setup_toolchain_env.py1570 passed, 3 skipped(pytest -q --deselect tests/test_image.py)just precommit(prek run --all-files): all hooks green, includingactionlintandyamllinton the edited workflowTwo local failures are pre-existing and environmental, both reproduced with
this branch's working-tree changes stashed, and
test_image.py::TestFileStructure::test_manifest_filesalso reproduced on aclean
origin/devworktree:test_image.py::TestFileStructure::test_manifest_files— the localghcr.io/vig-os/devcontainer:devimage carries the pre-8e7c4916.pymarkdown(959f081e…vs the tree's0ba0738d…); the image predates that2026-08-31 commit
test_integration.py::TestDevContainerCLI::test_github_cli_authentication—dbus-launchmissing in the container,ghrefusing a multi-account configmigration
Checklist
CHANGELOG.mdin the[Unreleased]section (and pasted the entry above)Additional Notes
Consumers pick this up on their next
devkit-upgradeadoption PR — the workflowis devkit-managed, so a consumer-side edit would be overwritten anyway.
Refs: #1599