We’re adopting Nix across our team and I’m curious how others handle flake management in monorepos.
Specifically:
Do you keep a single flake.nix at the root or per-project flakes?
How do you handle shared overlays and modules?
Any tips for keeping flake.lock updates from causing merge conflicts?
We’re currently using a single root flake with follows for inputs but it’s getting unwieldy as we add more services. Would love to hear what’s worked for others in production.
Sounds to me like you’re doing something a little weird. If you’re a development team, adding services shouldn’t be so common, and if you’re a devops team, you’d be working on a NixOS configuration, which would look very different.
Given that this is a commercial context, I’d suggest getting in touch with some of the consultancies and asking them for advice. They’ll be able to sign any NDAs you need to have a closer look at your exact use case and give recommendations.
Or, y’know, hire someone with expertise. I’m doing this kind of work at my current employer as we speak, and it’s taken a few months to come up with a good, hopefully future-proof design. And yet there is a bunch of work left to do.
Concretely, flake-parts can help, but it might also be the completely wrong approach, and there are mqny decisions to make down the line. You need to know what you want (and what you’re doing) if you want to end up with a clean solution.