Skip to content

build: Update nix config to match core Crossplane - #332

Open
adamwg wants to merge 1 commit into
crossplane:mainfrom
adamwg:awg/nix-updates
Open

build: Update nix config to match core Crossplane#332
adamwg wants to merge 1 commit into
crossplane:mainfrom
adamwg:awg/nix-updates

Conversation

@adamwg

@adamwg adamwg commented Sep 2, 2026

Copy link
Copy Markdown
Member

Description of your changes

Since we separated the CLI out of core Crossplane and copied its nix-based build system, three significant build changes have happened in core:

  1. We've started using nix's standard buildGoModule instead of gomod2nix in order to ensure the produced artifacts have necessary dependency data for security scanning (build(nix): build with buildGoModule so images are vulnerability-scannable crossplane#7549).
  2. The nix build has been updated to give each build job its own writeable home directory, solving the /homeless-shelter errors we occaisionally see in CI (build: give every Go build its own writable HOME crossplane#7652).
  3. The nixpkgs channel has been updated to the latest 26.05 from the EOL 25.11 (build: bump pinned nixpkgs channel from nixos-25.11 to nixos-26.05 crossplane#7715).

All of these changes are relevant improvements for the CLI build as well, so port them over. This should make our renovate runs more reliable (they often hit issue 2 today) and improve our security posture.

I have:

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: ea5294c5-714a-4492-83ed-2dd41a99d66a

📥 Commits

Reviewing files that changed from the base of the PR and between 65d9e92 and 2978362.

⛔ Files ignored due to path filters (8)
  • .github/renovate.json5 is excluded by none and included by none
  • flake.lock is excluded by !**/*.lock and included by none
  • gomod2nix.toml is excluded by none and included by none
  • nix/apps.nix is excluded by none and included by none
  • nix/build.nix is excluded by none and included by none
  • nix/checks.nix is excluded by none and included by none
  • nix/go-builders.nix is excluded by none and included by none
  • nix/vendor-hashes.nix is excluded by none and included by none
📒 Files selected for processing (2)
  • .github/renovate-entrypoint.sh
  • flake.nix

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The PR enables parallel Nix builds in the Renovate entrypoint. It removes the pinned gomod2nix flake input and exposes the vendor derivation through the new crossplane-vendor package output.

Changes

Nix workflow updates

Layer / File(s) Summary
Expose the vendor derivation
flake.nix
The flake removes the gomod2nix input wiring and adds the crossplane-vendor package output for nix run .#tidy.
Enable parallel Nix builds
.github/renovate-entrypoint.sh
The Renovate Nix configuration changes max-jobs from 1 to auto.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 29783

This PR updates the Nix build configuration, parallelizes isolated build work, and exposes the vendor package without introducing a concrete user or production impact that remains unresolved. No actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Breaking Changes ✅ Passed PASS. The pull-request diff changes only .github/, flake.lock, flake.nix, gomod2nix.toml, and nix/**. It changes no files under apis/** or cmd/**, so it cannot remove or rename public fi…
Feature Gate Requirement ✅ Passed PASS: The pull request changes only Nix and Renovate build configuration. The diff has no changes under apis/, cmd/, internal/, pkg/, or proto/, and go.mod and go.sum are unchanged. The …
Description check ✅ Passed The description explains the Nix build changes, their reasons, and the expected benefits for the CLI. It is directly related to the changeset.
Title check ✅ Passed The title is descriptive, matches the Nix configuration changes, and is 49 characters long, which is below the 72-character limit.
Full details: Breaking Changes

Explanation

PASS. The pull-request diff changes only .github/, flake.lock, flake.nix, gomod2nix.toml, and nix/**. It changes no files under apis/** or cmd/**, so it cannot remove or rename public fields or flags, add required public fields or flags, or remove behavior within the paths covered by this check.

Full details: Feature Gate Requirement

Explanation

PASS: The pull request changes only Nix and Renovate build configuration. The diff has no changes under apis/, cmd/, internal/, pkg/, or proto/, and go.mod and go.sum are unchanged. The changes replace gomod2nix with buildGoModule, add vendor-hash tooling, and set Renovate Nix builds to max-jobs = auto; these affect build and automation behavior, not an experimental product feature or API. The existing Nix experimental-features = nix-command flakes setting is unchanged.

✨ Finishing Touches 💡 1
⚔️ Resolve merge conflicts 💡
  • Resolve merge conflict in branch awg/nix-updates

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Since we separated the CLI out of core Crossplane and copied its nix-based build
system, three significant build changes have happened in core:

1. We've started using nix's standard `buildGoModule` instead of `gomod2nix` in
   order to ensure the produced artifacts have necessary dependency data for
   security scanning (crossplane/crossplane#7549).

2. The nix build has been updated to give each build job its own writeable home
   directory, solving the `/homeless-shelter` errors we occaisionally see in CI
   (crossplane/crossplane#7652).

3. The nixpkgs channel has been updated to the latest 26.05 from the EOL 25.11
   (crossplane/crossplane#7715).

All of these changes are relevant improvements for the CLI build as well, so
port them over. This should make our renovate runs more reliable (they often hit
issue 2 today) and improve our security posture.

Signed-off-by: Adam Wolfe Gordon <awg@upbound.io>
# needing to create the nixbld group and users in this ephemeral container.
build-users-group =

# One build at a time, so no build starts before we can clean up /homeless-shelter.

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.

@jbw976 thats what i mean is it safe ? with all your work around /homeless-shelter the last weeks?

@jbw976 jbw976 Sep 5, 2026

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.

great question, yes I think it is safe actually, because this PR removes the gomod2nix derivation that had to be built from source often. with that gone, all go builds we do will route through our go-builders.nix which gives each a safe HOME to write to instead of writing to the /homeless-shelter. Plus, we still have the clean-up in our crossplane-nix launcher and the post-build-hook to also help.

So I think we can use max-jobs = auto again safely! 🙏

@jbw976 jbw976 left a comment

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.

Thanks for making this update @adamwg! I think the vulnerability scanning improvement is critical just like it was for core crossplane, so thanks for taking the initiative to doing it here too 🙇‍♂️

Referring to the /homeless-shelter errors:

This should make our renovate runs more reliable (they often hit issue 2 today)

are you sure about that? after all the work we did in this repo to fix them, I thought that issue was fixed, e.g.:

i had my agent pull all the Renovate logs for the last month+ and it seems like we haven't seen one of those failures since Aug 8. Are you seeing otherwise?

That being said, the PR looks reasonable and my testing/builds seems to be working OK with these changes too. So LGTM! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants