I'm potentially interested in such a solution, as a kind of "gateway drug" and "incremental step", which might let me (and other people in similar situation) gently evaluate NixOS-like infrastructure approach, making the transition less radical and drastic than an immediate jump to full NixOS (which we cannot afford at my workplace).
I imagine some kind of "activation script" would be needed in such case, possibly with some additional systemd tweaks in the host OS (adding the ~/.nix-profile/lib/systemd/system/ of some special user, e.g. "nixos-guest", to systemd; also maybe adding some special 'nixos-guest.target' file? I don't know systemd very well...) I outlined my current ideas in the stackexchange answer I linked above:
Some challenges I'm still not sure how to resolve:
- how to rename/prefix Nix-generated .service files, to avoid conflicts with host OS's services?
- not all .service files should be automatically activated, only
the ones listed in some special list (e.g. "enabledServices = [...];") —
how to take care of this?
- how to disable old services in the "activation script" if they are removed from the list? (grep systemctl .service paths for '/home/nixos-guest/.nix-profile/'? or some smart setup with 'nixos-guest.target' and 'systemctl daemon-reload'?)
- [nice-to-have] would it be possible to manage such a system remotely with NixOps?
I'd be grateful for any hints!