Maintaining a custom NixOS "distro" for one non-technical user

I’ve been thinking about setting up my partner’s laptop with NixOS.

Their laptop was running Xubuntu, which caused some problems during the upgrade.

I installed Xubuntu on their old laptop a few months ago mainly because it’s underspecced and Windows was really bringing the performance down. It’s worked out great for a while, but the last dist-upgrade from 22.04 to 24.04 went sideways and left the laptop in an unbootable state. I had to come in with a live USB, chroot into the installation and finish it up from there, and even after making sure that the upgrade went well there were problems! systemd-resolved somehow was not installed, so domain resolution was not working when I booted back into it. In conclusion, I’d like to replace the Xubuntu installation with an immutable distro, because if an upgrade fails I just want them to be able to go back to a bootable system without having me stepping in. And I’m not going back to a “mutable” distro ever again :slight_smile:

The use case would be really simple: web browsing, reading documents, watching movies, managing their photos, some light videogames etc. They’re really not comfortable with the command line (and have no interesting in improving) so I was thinking of a setup somewhere along the lines of:

  • A flake with all the system configuration, including “system” programs like the DE. I would mostly be managing this config myself.
  • All “user” programs like the browser, OnlyOffice, video player etc. would be in a user nix profile and installed/updated by them through Nix Software Center.

Now, this is not a very powerful laptop and we wouldn’t want to build the system closure on it, so I’m planning to set up a cache server with nix-serve that will periodically update the flake inputs and build the system closure, so that when the laptop needs an update it will only have to fetch the packages from the cache.

The only thing I’m missing from this grand plan is some sort of GUI update system that fetches the latest version of the flake, compares it to the current version and displays a notification asking you to update, and then opens up a window that calls nixos-rebuild.

Has anybody managed a NixOS machine for somebody else in a similar way? Do you have any tips to share? Would this setup be interesting enough to package up for other people to use if I set it up?

1 Like

My suggestion would be to enable the gnome software center and let the user manage applications using flatpak. Things won’t be fully reproducible, but you can still ensure that the base system is nice and stable. Performing upgrades is still a manual cli process, perhaps once in a while you can have the machine update? Whether you do that automatically or trigger a deploy yourself would work.

I have thought about deploying NixOS for some less technical users, but the truth is that you will still be required to manage the system for updates and hardware support. If you have the time to commit to occasional maintenance then go for it!

1 Like

Flatpak is a good idea as well! Do you have any thoughts on that vs nix profiles?

I wanted to automate enough of this part so I don’t have to maintain the upgrades as much. I was thinking something like this:

  • The cache server periodically (maybe once a week/month) tries to update the flake inputs and build the system closure.
    • If it succeeds, it commits the updated flake.lock to the repo and creates a GC root for the system closure.
    • If it fails, I get notified in some way.
  • The laptop runs a script after startup that pulls the flake and, if there are any new commits, runs nixos-rebuild.

If the upgrade introduced any build time problems I’ll get an email or something and then fix it on my own time. If it introduces any “runtime” problems I’ll probably hear it from the user :stuck_out_tongue: and at this point I can tell them to select the previous generation while it’s booting and that I’ll look into it later.

(Maybe the GUI thing I mentioned would be overkill, now that I think about it.)

That’s true, but I think NixOS makes it much easier for me to fix issues when they come up. Right now the Xubuntu installation is malfunctioning and I have no idea how to fix that without doing a clean reinstall, so while we’re at it I might as well replace Xubuntu with something I actually know how to service. Better yet, with an immutable system they get to use the computer even if the upgrade went sideways!

This is not scalable on purpose, but I thought maybe the tooling around it could be useful for other people who don’t mind putting themselves in this situation.

1 Like

I think configuring/installing things via Nix is a good idea for constants that will not change. Desktop environment, some base applications, networking support, etc are good examples. Though other applications should be left up to the user to grab and install at their leisure. I think the easiest way for the user to manage that right now would be the software center gui. Flatpak is probably the safest bet for compatibility and ease of use for less technical users right now.

1 Like