#2 Add support for nix flakes via cargo2nix

Opened by ryanbooker on Apr 5, 2024, 12:00 PM
// ryanbooker on Apr 5, 2024, 12:00 PM

I’ve added support for nix flakes if you’re interested. I use nix for my rust environment rather than having it all installed system wide.

ryanbooker
~ ryanbooker pushed a change on Apr 5, 2024, 12:01 PM
· ryanbooker · on Apr 5, 2024, 11:52 AM
TEIPIE7JYQK6MX4TGZ7IMFEIE276YQSFP53VNOAHX2VDPCUIGWSAC
ryanbooker
~ ryanbooker pushed a change on Apr 5, 2024, 12:01 PM
· ryanbooker · on Apr 5, 2024, 11:56 AM
WXLAXIIWMB55NYS6YBN3CR3ERTU23HBSKKGVDDIMDP74CTCIECZQC
// laumann on Apr 10, 2024, 5:31 AM

I’m not familiar with nix and nix flakes, so this may be a dumb question: is this something we could put in a contrib/nix folder? It seems like the it’s packaging information for nix and it strikes me as odd to keep it in the source repository.

// ryanbooker on Apr 10, 2024, 6:00 AM

Nix (separate from NixOS) sets up an independent environment with everything required so that the global install space isn’t polluted. e.g. I don’t have anything related to rust directly installed on my machine. Instead I use nix to create the environment as needed. You could think of it (in this context) as something like Bundler for Ruby.

You can see something similar in pijul/pijul (though it uses a slightly different set up). It’s very common for the flake etc to live in the root, but I believe it can live somewhere else if preferred. I don’t really have a strong opinion either way, other than I usually see it in the root.

I have a commit locally, so if you don’t want it in the project at all that’s fine too! 😀