-
-
Notifications
You must be signed in to change notification settings - Fork 136
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 #1575
base: master
Are you sure you want to change the base?
Add nix flake #1575
Conversation
@thomas-zahner, @niklaskorz, any thoughts? |
@tirimia Did you see #1565? It's pretty much a duplicate of this PR. The main difference is that with my PR I didn't have Is it possible to easily specify the Rust version in this flake? If not I would probably prefer my approach. |
That’s the beauty of using the fenix flake and reading the toolchain configuration, that’s already taken care of and we then also know we provision rust like the non-nix users of the repo 🥳 In general though, I personally avoid thinking of the specific version of software when working with nix as it’s rolling release and if I need something specific, importing a pinned version of nixpkgs is still an open option. A further advantage of this PR is that people can reference this flake and use lychee without having to figure out how to build it on their own. You can also directly call it with |
@tirimia Ah I see, thanks for the clarification. I agree that this is probably the better approach. Does this mean that nixpkgs could simply reference our flake? |
Also would you mind if we add an |
Nixpkgs offers a reference to its packages via flakes as a convenience; flakes are not “officially” stable. You can, however, reference this flake in your own or in the command line |
I would avoid that. Direnv docs recommend you add .envrc and .direnv to your global git ignore. Committing it forces people to use the flake if they use direnv, and it also prevents people from having their own configuration As for the “stupid” questions: nix is a beast, the craft of tech is impossible to master in its entirety. Don’t judge yourself for not knowing things, enjoy that you get to learn 💃 |
As for |
Co-authored-by: Niklas Korz <[email protected]>
@tirimia @niklaskorz thank you for the answers and improvements. The flake now targets my platform but it still does not build because of the pinned SHA which is not the same on my platform. With the current version I get a mismatch: We can't simply remove the argument because it seems to be required: When an empty string is provided or if
So now I see two possibilities:
|
This PR enables building lychee via nix flake by simply running
nix build
.Simultaneously,
nix develop
will open a shell with the environment required to build and develop it.