Hi!
I’m announcing the first public version of unflake. It is a tool that allows non-flake projects to depend on flakes while unifying all the transitive dependencies. You can use it to avoid writing a lot of .inputs.nixpkgs.follows while still getting deduplicated dependencies; or to make dev shells for external projects without commiting flake.nix to the repo or copying the whole directory into store.
In a nutshell, it parses the same inputs format flakes use, enumerates all the inputs it needs (including transitive ones) and produces a Nix expression that fetches all these inputs, passes them their inputs and hands them to you. If your flake.nix looked like this
{
inputs = ...;
outputs = inputs: # your code
}
you can replace it with an unflaked version that looks like this:
let inputs = import ./unflake.nix;
in # your code
The rest of your code stays exactly the same.
unflake ignores flake.lock files in your dependencies: with unflake, you only get one copy of every distinct input. (There’s even a way to deduplicate it further, e.g. merge github:nixos/nixpkgs/nixos-unstable with github:nixos/nixpkgs/nixpkgs-unstable — check README for that). All the dependencies (including transitive ones) are locked at the top level — unflake can do it itself or integrate with npins.
It’s a first public release, so there’re probably some bugs (I’d appreciate bug reports!), but I use it for my own system closure which has a lot of dependencies and it works fine. README has more info and I’m happy to answer any questions you might have!