Ubuntu + NixOS-like "overlay"?

(cross-posting from Reddit — sorry, I didn’t realize there’s now a discourse forum until just a moment ago!)

I’d be interested in experimenting with a solution, which would allow me to try “gradually” introducing NixOS on some servers, as an experiment. This would have to be based on a Ubuntu base system, as I want to be able to quickly fall back to a known stack in case of problems with NixOS (or with using it). Did you ever try such a thing? Do you have some infrastructure you could share? Do you know of someone who did it?

I’m thinking something like this could be done in a way somewhat similar to NixOS; but only selected files in selected directories would be linked to the /nix/store/… on each “nixos-overlay-rebuild”, instead of the whole system — for example, only definitions of “new” systemd services, etc. (while keeping original Ubuntu services intact). I think this could be maybe even done by reusing most of the nixos/ tree of nixpkgs.git, with some changes: (*) nixos-rebuild would not be used, instead some replacement adding/removing links as necessary; (*) the bootstrap etc. parts of the system would have to be somehow ignored. Unfortunately, I don’t have time & capacity to try this. But I’m wishing for such a thing repeatedly… I feel it could potentially be the gateway drug, helping to take over the world with NixOS, by tiny steps…

1 Like