kimb.dev

IRL Flake Discourse, loose thoughts

(These are loosey-goosey notes I’m sharing to get in the habit of posting. Please don’t let this poison you on flakes if you’re starting out with nix, if you have a modern computer with a good broadband connection, they’re probably the right choice.)

My first day at Nix Camp, I made the rookie error of joking about how “everyone uses flakes,” which it turns out is not true. The impression I got from Reddit and online discourse is that flakes are unstable from a poor RFC process and a few failures of flakes to guarantee truly hermetic builds.

Flakes do offer some good stuff, like pinning dependencies explicitly for your project. However, they also have their own domain-specific-language on top of the dsl used within a nix module. I don’t think I entirely get the difference, as evidenced by every time I want to make a one-pager flake and realize I have no idea how to do a simple mkDerivation package. They also call on checking every input and its dependencies, and if someone doesn’t properly implement nixpkgs.follows, your NixOS system then has to deal with two versions of Nixpkgs. As I understand it, that means doubling up on what could be common dependencies.

A more mature solution would hopefully account for those issues, but that better solution doesn’t seem forthcoming? For now, I’ll continue to use flakes to build my systems, but I’m thinking I might try some modules without flakes but using the more ergonomic nix-experimental commands like nix build where possible. Especially after hearing a lot of assorted complaints about nix-shell over nix shell. I’d really like to have more context on this stuff. Maybe I need to read the Nix Thesis and then go through the environmental storytelling of the Nix Flake RFCs and following discourse posts. I also oughta get a NixOS Discourse account, now that I know Nix Developers are generally nice guys who won’t fly a murderdrone at my cat. (Droners Lucky is an outlier and should not be counted)

Reply to this post by email ↪