-
-
Notifications
You must be signed in to change notification settings - Fork 140
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 shell #1565
base: master
Are you sure you want to change the base?
Add Nix shell #1565
Conversation
From my side, this looks good. |
Sorry that we didn't get to go through it during RustLab anymore. A few possible improvements:
|
@niklaskorz No problem, thank you very much for the detailed comment. I will try to apply your suggestions and merge it this weekend, as I will be attending a local Nix meetup |
3370746
to
88009df
Compare
b94e4a3
to
81f4ce6
Compare
@niklaskorz @mre I'm now using flakes as they were also suggested by colleagues at the Nix meetup. The Rust version can be easily changed in the variable and it works flawlessly on my side. So if you have no more objections, I will merge this. |
Looks good on my end, but I have no idea of Nix. |
For info, this config is only working for x86. We should be able to make it compatible with other platforms, for example by using nix-systems. But for now this should suffice. |
Supporting multiple systems without external dependencies like flake-utils or nix-systems isn't too hard either, see e.g. https://github.com/niklaskorz/rustlab2024-wgpu/blob/ch1/flake.nix Edit: Also, it's easy to support both experimental flakes and stable non-flakes users by just importing |
@thomas-zahner, I talked to @tirimia about Nix and that there's a PR for lychee. He took a look and created another PR. Maybe you can check it out and see which one we're going to merge in the end. 😉 #1575 |
5827856
to
4c1e0f5
Compare
@tirimia Thanks for you suggestions on your PR. I agree that the .envrc could potentially be annoying/unwanted. So I've now removed it and also made the flake compatible with other platforms as suggested also by @niklaskorz. I have also tried to add a build config but didn't succeed yet. If you want you could to add it via PR, that would be great. If you have any other suggestions on this PR, please let my know. Otherwise I'll merge these changes. |
So I've installed Nix OS a week ago. Because of this I created this Nix shell. This way it should be possible to reliably build and develop lychee on any Nix system. I've taken the Custom Rust version example from Nix's documentation and simply added pkg-config and openssl. I'm not proficient at Nix so I'm not sure if this follows best practices. But I know it works on my system and since it's Nix it should basically work on any system :)
@niklaskorz what do you think about this.