Right! At some point, we could see somethinf like this in the Nix world— call it the Grand Unified Module Systwm— but right now, NixOS modules make NixOS-specific assumptions (e.g., total ownership of /etc., the use of systemd, etc.). Thus, use of such modules in other contexts (e.g., macOS in the case of Nix-Darwin, or Linux without running the whole show in the case of Home Manager) requires a distinct collection of modules.
There's been some experimental work towards this end for a long time, once under the banner of a 'service abstraction layer' for NixOS, and more recently Sander van der Burg's 'Nix Process Management Framework'. But right now, none of the mature module systems are 'universal' in the sense of being usable in all of the many environments Nix can run in.
If you were going to roll your own solution, imo using the latter of those efforts (nix-processmgmt, probably backed by supervisord) in a flake.nix or shell.nix seems like a sensible way to go. At the same time, I think using devbox to wrap all that config looks like a pretty nice way to go for teams or projects that don't already have much Nix buy-in.
I'm currently using s6 directly. It's actually pretty okay. Going to spend some more time with it as we have some more specific wants and needs than teams with less buy-in
Yeah, I think that's also a sound choice if you know you'll need more customization and you have some familiarity/preference for an existing process management tool.
Anyone know of a developer setup that uses Systemd to setup encapsulated development environments in a similar way? That sounds like it could work very nicely and wouldn't require nix.
There's been some experimental work towards this end for a long time, once under the banner of a 'service abstraction layer' for NixOS, and more recently Sander van der Burg's 'Nix Process Management Framework'. But right now, none of the mature module systems are 'universal' in the sense of being usable in all of the many environments Nix can run in.
If you were going to roll your own solution, imo using the latter of those efforts (nix-processmgmt, probably backed by supervisord) in a flake.nix or shell.nix seems like a sensible way to go. At the same time, I think using devbox to wrap all that config looks like a pretty nice way to go for teams or projects that don't already have much Nix buy-in.