Thanks for the tips of using flakeCompat, I will need to take a deeper look to understand that.
IMO, You don’t need to put all inputs into the main flake, especially for the trivial or dev inputs, such as pre-commit, devshell, etc. It’s an efficient way to avoid the flake inputs getting bloated and prevent an unbounded stretch of flake inputs. The downstream users will introduce a light flake, then load the flake’s functions lazily.(just a personal idea)
I cribbed from flakes-compat that I could use but then I have to explain to my coworkers that run some bespoke Nix framework and you can’t use X, Y, Z.
So, it has a risk for the flake-comapt? I’m using an optioned way and modified flake-compat to manage a monorepo. Hence, I probably wouldn’t recommend that for my use case without being sure of some real environment.
Hey I was the author of the linked thread. I wound up creating this incredibly useful template that I drop alongside every flake now. Strongly recommend it.
While using a path: URL does fix the always-changing lock file issue, I now have a different problem: whenever I change something in the sub-flake these changes are not immediately “propagated” to the parent-flake. Instead I have to recreate the lock file (or, more specifically, update the lock file entry for the sub flake). While I suppose this happens because the sub-flake is getting locked properly in the lock file, I do not think that this is desired behavior most of the time. Is there any way to make this automatic?
Thanks, but after a quick test this does not seem to help in my case. My use case is this: I currently have one flake that provides nixosConfigurations for multiple hosts. I would like to split this into one sub-flake per host, primarily to isolate their inputs, e.g. the used nixpkgs. These nixosConfigurations from the sub-flakes should be “re-exported” in the parent flake. For ease of updating I would still like the inputs of the sub-flakes to be locked in the parent flake lock file, i.e. what’s happening with a path: URL. call-flake (and also get-flake) would require lock files for the sub-flakes, AFAICT.