Flakes: How to keep multiple Flakes in sync?

I am using a Flake for my system configuration, in multiple projects, and for some custom packages. It seems to me that it would be a good idea to have most/all of them depend on the same version of the Nixpkgs Flake (and possibly others, but Nixpkgs comes to mind first). Of course there is no strict requirement for that, but my guess is that I’d end up with a smaller store, less downloads, etc. for the packages that are shared between multiple Flakes.

I don’t want these Flakes to explicitly (via Flake inputs) depend on each other (or an intermediate flake that could pin Nixpkgs), since that would just move the problem.

What I am thinking of is a command line tool that “knows” about all Flakes that I have in my filesystem, and compare their lock files, telling me which use newer inputs, or so.

Does that even make sense? Is anyone doing this?

use follows.

Thanks for your reply.

follows is a feature of the dependency mechanism of Flakes, which I mentioned above:

What I am thinking of is a command line tool that “knows” about all Flakes that I have in my filesystem, and compare their lock files, telling me which use newer inputs, or so.

In fact I am already using follows for most/all the Flakes. However, they may still pin/follow a different revision of Nixpkgs.

If I introduce a “myNixpks” flake, that then “centrally” depends on Nixpkgs, I’d just shift the problem, because all my other Flakes can now depend on different revisions of myNixpkgs.

In the meantime I wrote a script that looks for all Flakes on my system, collects their lock files, and picks our the newest locked Nixpkgs revision: https://github.com/lorenzleutgeb/nix-flake-sync

Set nix.registry.nixpkgs.flake = nixpkgs that way all your local flakes use the same version when you update them the or if you use --override-input nixpkgs nixpkgs