[perf] Cache nixpkgs resolution #2576
Merged
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.
Summary
This caches resolutions for unlocked nixpkgs (the default) for 90 days on the user's machine. Otherwise, everytime devbox tries to resolve
github:NixOS/nixpkgs/nixpkgs-unstable
it will download a new version of nixpkgs. This is slow (40+ seconds) and usually nothing changes.If a user wants to update nixpkgs there are two ways of doing it:
devbox update
without any arguments will update nixpkgs. This is existing functionality.devbox update nixpkgs [...pkgs]
will also update nixpkgs.I'm not convinced updating nixpkgs when using
update
without arguments is best, but I didn't want to break past functionality. It adds 40+ seconds to update operations when there is no package to update.An alternative command syntax considered was
devbox update --nixpkgs
. The benefit of doing this would be to avoid conflicts in the future.I did not use
stdenv
because it already exists and it is a different package.Bug fixes:
devbox update go
) no longer updates nixpkgsAlternative approaches:
How was it tested?
devbox update
with and without packagesCommunity Contribution License
All community contributions in this pull request are licensed to the project
maintainers under the terms of the
Apache 2 License.
By creating this pull request, I represent that I have the right to license the
contributions to the project maintainers under the Apache 2 License as stated in
the
Community Contribution License.