Organizing your Nix configuration without flakes

17 points by knl


Diti

The writer of the article forgot to mention the best part of flakes: caching.

sandro

sometimes it feels like every module structures everything a little differently

Before flakes this was the norm and every repo you drew in did whatever. It was the norm to have somewhere an import <nixpkgs> { } or fetchTarball inbetween and evalled another nixpkgs.

The example of npins even promotes this anti pattern and nudges people into make their nixpkgs input not overwritable and pinned which for many repos is unnecessary and just makes you use another set of (outdated) dependencies. https://github.com/andir/npins/#quickstart

All the other tools don't solve peer dependencies consistently.

j4m3s

Also, flakes forbids you from calling <nixpkgs> which depends on channel (via env variables and NIX_PATH). This is also doable on basic nix but not the default. Depending on channels was such a PITA to me at first (not understanding why evaluations on 2 different machines gave different results). I think people wrap their nix builds and override NIX_PATH to make it fail to depend on global env.

Also agree that flakes schema is a bit lacking.

somasis

hey that's me :)

xjix

Personally I like flakes, but I would like to see improvements and it kinda seems like they're languishing these days. I'm not sure what the plan is for flakes in Lix, but I'm really open to anything that works well and is at least somewhat decentralized.

There's a lot about the flake schema that I like, despite the limitations and I've really enjoyed working with flake parts modules lately. This post is an interesting combo!