4 ms·
Nix supports this quite well. https://nixos.org/manual/nix/stable/#multiple-versions https://nixos.org/manual/nix/stable/#multiple-versions The Nix and contai
by xxpor 5y ago
Nix supports this quite well.
https://nixos.org/manual/nix/stable/#multiple-versions https://nixos.org/manual/nix/stable/#multiple-versions
The Nix and container mindset are very similar in that they refer to all of their dependencies, including down to glibc.
- xyzzy_plugh 5y agoNot quite. This is true for dependencies such as libraries but for services it's significantly trickier. Postgres, for example, would require configuring each version to use a distinct space for storage and configuration if you want to run them concurrently. It's still pretty easy with NixOS, but not as simple as you make it seem.
- xxpor 5y agoIt's one line of override configuration, how is that not trivial? Edit: Totally granted, figuring out that one line the first time might take 6 hours, but once you know how to do it you're good to go the next time. The documentation could certainly be improved.
- tyingq 5y agoDoes Nix understand network namespacing? Or would 2 postgres instances clash over tcp listen ports? I get you could configure different ports, or virtual interfaces, but it sounds like either of those would be outside of the nix tooling.
- wyager 5y agoI don't think it would be possible to do this in an OS-agnostic way. LXC and jails are too different, and I'm not even sure what the option would be in macOS.
- ratorx 5y agoI don’t think NixOS (where service configuration would live) is system-agnostic. It relies heavily on systemd already.
- xxpor 5y agoYou would have to deal with that yourself. But it's typically just a variable in the service definition, so it's very easy to override.