Using home manager only - /etc and other nixos options

Hi there, I generally use nixos full-time, but I just got a work laptop where I cannot run nixos (will be Ubuntu). So I was considering just using nix/home manager, and refactoring all my modules to favour home-manager related options for reusability.

But I am curious how others are dealing with items such as managing /etc, or other areas of the system that traditionally use nixos options. I do not want to have multiple helper scripts to manage those parts; otherwise, I may as well maintain a shell script for the whole thing. I might be stubborn on this, though. heh.

Just curious about the approaches people take to using Nix on a non-NixOS Linux. I appreciate it.

Cheers.

I only use NixOS but have found that almost everything can be done on the user level. Depending on your needs it could be that standard Ubuntu and home-manager modules will be enough.
Beyond that, maybe you could try GitHub - numtide/system-manager: Manage system config using nix on any distro?

Do you want to run home-manager as root? I don’t think you do, and if you don’t, then you can’t really manage /etc et al. I ran arch + home-manager for years and was mostly satisfied with just leaving the system level stuff to more traditional means (i.e. just doing imperative stuff, updates + pacdiff from time to time to check on my configs vs shipped). I think you can get 99% of the benefit that way without working that hard. Otherwise your best bet is probably as @junestepp suggested looking at system-manager, but I would wager that you will get less out than you put in.

This is a single-user system, and my use of Nix is about configuration and package management. So I do not always follow some of the Nix paradigms. So, at times when I can only meet my primary goal, I sometimes take the less preferred approach under consideration.