-
Notifications
You must be signed in to change notification settings - Fork 11
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 Nix flake #245
base: master
Are you sure you want to change the base?
Add Nix flake #245
Conversation
Warning: The test `options::common::address::tests::resolve_should_properly_resolve_bind_address` fails on my system, which is x86_64-unknown-linux-gnu running NixOS.
@myclevorname Hi! Thanks for this. I'm aware of Nix and associated software, but no nothing of the flake file and format. Looking through it, there are multiple version references that I'm assuming I would need to maintain? The version key is set to Separately, I need to now maintain a Cargo hash. I'm not familiar with this based on the lock file. Is it a hash of the lock file itself? Lastly, there's a list of targets that I'm assuming apply to Nix? Is this supposed to match our full triple target format? Or something specific to Nix? For example, we also offer aarch64 for Linux and support GNU and musl variants of x86 and aarch64 for Linux. Also, ignore the linting errors. We use the latest Rust release's linter, and I haven't run a PR recently, so there was probably something additional added that I'll need to correct. Once I figure out the above questions, I can merge this in. |
The version argument is completely optional, but I added it for some reason. When you update the cargo lockfile and run |
Wait, so is it purely cosmetic? Just figuring out what I need to set it to, and if the
@myclevorname okay, so I need to have |
The version argument is only required when making a Nix package. It wasn't as smart idea for me to add it when this is a flake. There may be a Github action that supports Nix, so you may be able to update it using that. |
As of right now, I am refactoring the flake to use flake-utils instead of hard-coding the targets in the flake. |
What is currently blocking the PR? Would really love to have distant install on my NixOS system. |
The only blocker is the failing test "options::common::address::tests::resolve_should_properly_resolve_bind_address" because Nix prevents packages from accessing the network at build-time. Right now, I am working on ignoring this test when Nix builds the package. |
Oh I see thanks. I decided to disable all tests as a temporary workaround. |
That sounds like a better idea. |
Would it be possible to get some nix deployment integrated into the release workflow, or a nix specific github workflow? I don't use nix and therefore wouldn't be able to maintain the file properly, so anything we can do to automate it would be fantastic. Both on the file, and the deployment that you need me to do. Going back to my questions earlier about needing
Anyone here familiar with github actions that are commonly used with nix? |
I think it would be best to make it separate, and check for I have looked through some of the nix actions none of them provide updating the hash in a The basic gist of what has to be done is the follows:
We can use paths-filter for the first step, which should guarantee that Note that I am not very familiar with Actions. |
Thanks for the input, @zDonik1. I think the hard part is getting the hash programmatically. Is the messaging consistent when it fails to build? Is there no other way to leverage |
I have looked through the nix code to see how the hash is generated but no luck. Maybe you will have more success. But note that the hash is generated by serializing the input (or output, not sure which) directory into NAR and hashing that using sha256. there is a command you can try using |
Here is what the output on my machine looks like if the hash was mismatched.
If there is an error with the hash, you should be able to extract the text |
Warning: The test
options::common::address::tests::resolve_should_properly_resolve_bind_address
fails on my system, which is x86_64-unknown-linux-gnu running NixOS.I turned this into a flake by request of @dgmcguire.