The sound distributed version control system

#22 Flake support

Closed on November 12, 2020
cole-h on November 10, 2020

Some systems that use flakes don’t have a NIX_PATH (or nixpkgs in the NIX_PATH).

cole-h added a change on November 10, 2020
This change could not be retrieved at the moment
DN3X6ZT3YVEGTHYDCDB7U6GNH5YVP37GMPZLUHT64OUWITHLHEKAC
fabian on November 11, 2020

Nice, I didn’t know about flakes :3

Here is an intro I am reading as a reference: https://www.tweag.io/blog/2020-07-31-nixos-flakes/

jwaksbaum on November 11, 2020

I made a few changes on top of this change, to:

  • use cargo2nix, which among other things, allows us to add dependencies directly to crates we depend on instead of to the top-level pijul crate.
  • use flake-utils to remove boilerplate
  • add a devShell so that nix develop can be used to start a development shell in which we can use cargo as usual. It also includes rustfmt as an example of a useful development tool, and cargo2nix to allow regenerating Cargo.nix.

These aren’t fully cleaned up and haven’t been tested on darwin, but I figured I’d share them.

jwaksbaum added a change on November 11, 2020
This change could not be retrieved at the moment
HNXQOO7YHQPVCYDBSHFUZTSMF3P3YQ7SCX2CUFVF55GHEMMSIHPQC
jwaksbaum added a change on November 11, 2020
This change could not be retrieved at the moment
XTS3Q2G2SOTON7TGW37QBPSPEKK2YG6TFGYVEBIQJV4R5MGLOUYQC
lthms on November 11, 2020

@pmeunier developed carnix at some point, I don’t know what is the status of the project nowadays though.

jwaksbaum on November 11, 2020

I think cargo2nix is based on carnix, and I think here @pmeunier mentioned that he wanted to end up using cargo2nix, which is why I wanted to give it a try.

cole-h on November 12, 2020

@jwaksbaum A few things:

  • I already added a devShell in the original flake.nix ;)
  • I think the boilerplate is better than having to fetch another source. It’s only 8 lines.
  • crate2nix is a great idea. I just didn’t have any experience in using it.

Considering flake support has landed in main, I’m going to close this issue. Please open another one for your crate2nix change!

cole-h closed this discussion on November 12, 2020