Show Nix: Using Flakes as a dev tool to Manage a Scope, for downloads only

I wanted to demo something I thought some people here might find interesting: an internal-only use of flakes to manage a scope of 170 Common Lisp packages directly from their original source. I initially used classic pkgs.fetchFromGitHub declarations for each package but it made scope-wide updates quite frustrating, involving a kludgy Emacs macro and custom nix tree walker. Now I just run cd inputs; nix flake update and voilà. :slight_smile:

The flake: https://github.com/hraban/cl-nix-lite/blob/74b9197f25abd5fc5d8cdaa902d0d21be1096aa5/inputs/flake.nix

I use flake-compat to actually read that lock file into the “real” derivation. A forked, Fixed-Output Derivation (FOD) version of flake-compat; GitHub - hraban/flake-compat"

This flake is technically only really used as a dev tool to generate the flake.lock, which is the actual file used during evaluation. The flake UI is great at managing many separate inputs, updating and fetching them all individually.

Not an entirely conventional use of flakes, so I thought you might enjoy it!

P.S.: Yes the FOD flake-compat effects a lot of Import From Derivation (IFD), but it’s the least bad solution I can come up with for a massive flake.lock like this to really only download those resources that will be eventually used. If anyone has better ideas of course I’m all :ear:

3 Likes