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.
Context
We currently publish Devbox as a package in the
nixpkg
repository, but this version is often far behind our latest released version. For example: 22.11 currently hasdevbox 0.1.0
, while unstable hasdevbox 0.3.4
(we're on 0.4.2 as of this PR).By publishing a flake, we could make it easier for developers using NixOS, Nixpkg, or Home Manager to install Devbox on their system. Developers could add our repo + release tags as an input, and then have access to the latest versions as soon as we publish them.
With this installed, developers using Nix could install devbox with something like
or adding
to their flake.
Changes / Limitations with this PR:
go.mod Hashes - We need to provide Nix with a sha256 of our vendored dependencies in order to build Devbox. We can do this by either adding a
vendorSHA256
to our Flake, or usinggomod2nix
to generate a module with the hashes of all the dependencies in ourgo.mod
file. This PR goes with thegomod2nix
approach.Version Number - The version number currently needs to be set and updated manually in the Flake. This is because Flake outputs don't have access to the repositories branches or tags. We could pull this version from a file in the repo, or by running a script that reads the tags.
Branch/Refs - To make it easy to install the latest version, we'll need a ref in our git repo for
latest
orstable
. This could be a branch or a tag, and should be updated whenever we make a new full release.How was it tested?
With
nix command
andflakes
enabled:nix build
nix flake