Skip to content

fix: repin the npins template, run backend CI on main, emit valid nixConfig names - #146

Merged
vic merged 2 commits into
mainfrom
fix/npins-template-ci-nixconfig
Oct 12, 2026
Merged

vic merged 2 commits into
mainfrom
fix/npins-template-ci-nixconfig

Conversation

@sini

@sini sini commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • npins template: templates/npins/npins/sources.json pinned nixpkgs to the moving channels.nixos.org/nixpkgs-unstable/nixexprs.tar.zst URL with a fixed hash, so on a fresh checkout nix-shell . -A flake-file.sh failed with a hash mismatch. The file was also npins format 7, which npins 0.5 refuses ("Version 7 is too old"). nixpkgs is now a Channel pin with an immutable releases.nixos.org URL, and the file is format 8. The other pins keep their revisions and hashes. Their repository.owner now matches the denful URLs the file already used.
  • npins CI job: it injected npins.pkgs, which fails with "The option npins' does not exist". The option is flake-file.pkgs`.
  • Backend jobs never ran on main: the npins, flakeless-parts, unflake and tack jobs only ran on PRs with a matching label. Each if: now also passes on github.event_name == 'push', which the workflow already limits to main. The label path still works.
  • flake-parts-builder: it wrote nixConfig.extraSubstituters and extraTrustedPublicKeys, which Nix does not recognise. It also wrote them as empty lists when a part declared none. It now writes extra-substituters and extra-trusted-public-keys, and only when the list is non-empty. templates/parts/flake.nix was regenerated with write-flake.

Validation

  • The npins CI job run locally. On main it fails with the hash mismatch. With only the repin it fails with the npins option error. After the fix it exits 0, and running write-npins again leaves sources.json unchanged.
  • The flakeless-parts, unflake and tack jobs all exit 0 locally. They will now run on push to main.
  • New test-flake-parts-builder-nixconfig in dev/_bootstrap-tests.nix: it passes on this branch. It fails on main, where the output has extraSubstituters = [ ... ].
  • nix-shell ./dev/bootstrap-tests.nix --run test-all: all 27 tests pass.
  • In templates/parts, nix flake check --override-input flake-file <checkout> passes. With the old flake.nix it fails, and check-flake-file shows the stale nixConfig block.
  • nix run ./dev#fmt -- --ci reports 0 files changed.

…Config names

templates/npins pinned nixpkgs to the moving channels.nixos.org tarball
with a fixed hash, so a fresh checkout failed with a hash mismatch, and
its sources.json was npins format 7, which current npins refuses. Repin
nixpkgs as a channel pin (immutable releases.nixos.org URL) and upgrade
the file to format 8.

The npins CI job set `npins.pkgs`, an option that does not exist; it is
`flake-file.pkgs`. The npins, flakeless-parts, unflake and tack jobs
only ran on labelled PRs, so they never ran on main; run them on push
too.

flake-parts-builder wrote nixConfig.extraSubstituters and
extraTrustedPublicKeys, which Nix does not recognise, and wrote them as
empty lists when a part declared none. Emit extra-substituters and
extra-trusted-public-keys, only when non-empty, and regenerate
templates/parts/flake.nix.
@sini
sini force-pushed the fix/npins-template-ci-nixconfig branch from df91dae to 5ec488e Compare October 12, 2026 20:26
cd templates/npins
sed -i 's/# flake-file = import/flake-file = import/' default.nix
echo "{ inputs, ... }: { npins.pkgs = import inputs.nixpkgs {}; }" | tee modules/pkgs.nix
echo "{ inputs, ... }: { flake-file.pkgs = import inputs.nixpkgs {}; }" | tee modules/pkgs.nix

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

good catch

@vic
vic merged commit 97c8f80 into main Oct 12, 2026
11 checks passed
@vic
vic deleted the fix/npins-template-ci-nixconfig branch October 12, 2026 20:33
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