-
-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for installing using Nix (zero maintenance) #76
Conversation
This one works for development workflow, with a functional rust-analyzer for using with language server support in IDEs. Also add .vscode/ for pre-configured settings.
Use https://github.com/nmattia/naersk This avoids having to set a sha and version in Nix scripts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nitpicks, looks great otherwise!
BTW, maybe you could consider adding .envrc
with use flake
for those of us who use direnv+nix-direnv
.
@soywod This PR fails for 0.2.4; I believe that's because Error message,
|
Ah yes indeed, I bumped the version without launching back cargo build, I will update tomorrow |
By the way, Nix is also useful for non-development purposes, such as wrapping |
Well, you can export a NixOS module that uses home-manager, or a home-manager module (though that's not as standardized). |
I've created a template repo based on this work: https://github.com/srid/rust-nix-template |
@balsoft Do you know what the idiomatic way is to add dev-shell Rust dependencies in Nix? For eg., to make Or certain crate tools available in nix-shell, eg: |
@balsoft Do you know of an idiomatic way to override a crate dependency to point to a git fork? I noticed that Cargo.toml supports this, but we can't use it because the fetch will fail during nix build (due to blocked network access): # Cargo.toml
postgrest = { git = "https://github.com/srid/postgrest-rs", branch = "notokio" } I also tried adding something like this to postgrest = oldAttrs: with pkgs; {
src = inputs.postgrest-rs;
}; |
Ah. Looks like you have to specifying the source in both places (Cargo.toml and flake input+override); then it works ... mysteriously. |
I thought I fixed this here: nix-community/crate2nix#154 (but only on Nix 2.4) |
a67ac7d
to
1c6f249
Compare
Co-authored-by: Alexander Bantyev <[email protected]>
@soywod I believe this PR is ready to be merged anytime. (I keep merging it with |
❤️ Thanks a lot for your giant contribution guys! Feel free to write an entry in the wiki about Nix (if you judge it necessary, ofc). |
In fact, maybe it makes sense to move the Nix section from the README to the wiki, in the Installation section? I would like to keep the README as short and concise as possible (I need to work on it), and to move all the real documentation to the wiki. |
This is an improved version of #73 (and resolves #70) wherein the need to change the version and hash every time the Cargo files change is avoided. Now you can just forget about the .nix files (unless a new C dependency is being introduced).