nix: a collection of improvements to the flake#2646
Open
iniw wants to merge 5 commits into
Open
Conversation
this makes the flake smaller and way faster to build.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Hi! I'm using tonic for a personal project of mine and cloned it locally to take a better look at the examples.
As a nix user my first instinct was to check whether the project had a devShell, which it did! Yay!
Immediately after entering it, though, I saw that git started tracking
.pre-commit-config.yaml, which is created automatic by thegit-hooksin the flake.The first commit adds this file to
.gitignore.Then I opened the example I wanted and noticed that the build scripts failed to compile and rust-analyzer complained that
OUT_DIRwasn't set. I looked at the LSP logs and saw thatprotocwasn't in the path, which I would've expected to have been made available by the devShell.The second commit adds
protobufto the devShell.Now the
OUT_DIRerror was gone but there were still build-script related failures. This time the LSP logs revealed thatprotocv34 was expected but I was using v31.The third commit updates the lockfile so that the newest v34 protoc is used :)
After updating the lockfile, I noticed that devShell took quite a bit to build, and realized that it was because the project uses
fenixto obtain a rust toolchain. This turns out to be completely unnecessary since the project uses a stable toolchain, which nixpkgs already has packages for, so we can just them. This makes the devShell significantly faster to build since all of those packages can be substituted.The fourth commit replaces
fenixwith nixpkgs's toolchain.The fifth and final commit is simply some cosmetic adjustments to the flake's description and input formatting.
Thanks a lot for the project. It's been wonderful to use.