Nix itself also has an implementation of significant parts of the logic in flake-compat.
While this is somewhat necessary due to a few differing technical requirements, the overlap is currently swept under the rug instead of taken advantage of.
I would suggest to
-
carefully factor parts of the flake-compat logic into library functions with few dependencies (perhaps including logic from allNodes)
-
do the same for call-flake.nix
-
compare, figure out the identical ones, and "mark" them as such,
either:
- a clearly marked section in the file
- a separate file
I have a slight preference for the latter. Nix can have a two-file call-flake, I'm sure.
Another thing to pay attention to is that we have an internal, hidden and rich allNodes structure that's not the typical _type = "flake"; view of the flakes, but allows sources to be accessed separately. I feel like that structure will have a larger role to play.
Possible the inputs should also be part of that, I don't know.
(Disclaimer, this is of course somewhat vibes based after having worked with these files before. Some of the latter ideas might not work out, idk)
Nix itself also has an implementation of significant parts of the logic in
flake-compat.While this is somewhat necessary due to a few differing technical requirements, the overlap is currently swept under the rug instead of taken advantage of.
I would suggest to
carefully factor parts of the flake-compat logic into library functions with few dependencies (perhaps including logic from
allNodes)do the same for
call-flake.nixcompare, figure out the identical ones, and "mark" them as such,
either:
I have a slight preference for the latter. Nix can have a two-file call-flake, I'm sure.
Another thing to pay attention to is that we have an internal, hidden and rich
allNodesstructure that's not the typical_type = "flake";view of the flakes, but allows sources to be accessed separately. I feel like that structure will have a larger role to play.Possible the
inputsshould also be part of that, I don't know.(Disclaimer, this is of course somewhat vibes based after having worked with these files before. Some of the latter ideas might not work out, idk)