Skip to content

Conversation

Lagoja
Copy link
Contributor

@Lagoja Lagoja commented Sep 27, 2024

Summary

This adds a flake.nix to our repo for building and distributing Devbox. This will make it easier for developers who install Devbox with Nix to use pre-releases, and keep Devbox up-to-date on their system.

This changes our workflow in a few small ways:

  1. Whenever go.mod changes, we'll need to run devbox run update-hash to update the vendorHash for the flake. You can also run this script when you run go mod tidy
  2. Releasing a new version will also require us to update the version number in the flake.nix. This should be done with a commit ("Bump version to x.y") that also gets tagged with the release number.
  3. For debugging purposes, the flake will add the shortened commit hash to the version string. This also helps identify if a user built the binary from a flake.
  4. I've added a test to cli-tests that will build the flake. I've confirmed that it will fail if the vendorHash is out of date or incorrect
  5. We'll periodically need to run nix flake update to update the flake.lock file.

How was it tested?

  1. Ran nix build . in the Devbox repo, confirmed that the resulting build worked
  2. Tested the Github Action by pushing an invalid vendorHash

Copy link
Collaborator

@gcurtis gcurtis left a comment

Choose a reason for hiding this comment

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

This is awesome, thanks!

Lagoja and others added 3 commits September 27, 2024 16:14
Co-authored-by: Greg Curtis <[email protected]>
Signed-off-by: John Lago <[email protected]>
Co-authored-by: Greg Curtis <[email protected]>
Signed-off-by: John Lago <[email protected]>
Signed-off-by: John Lago <[email protected]>
@Lagoja Lagoja merged commit 37c36a1 into main Sep 27, 2024
29 checks passed
@Lagoja Lagoja deleted the jl/add-flake branch September 27, 2024 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants