Trying to setup a modular and fully reproducible OS

I folks. I’ve caught what I can only imagine is some sort of brain bug that makes me fascinated by fully reproducible systems and so I’ve been trying to understand how to overall shift my entire OS and setup towards a more composable, plaintext defined setup. The system I imagine I’m seeking would be one with as minimal (or immutable) an OS as possible, with all applications and services defined in plaintext (git trackable) files that I could then be layered together as needed.

To this end, I’ve recently shifted over to Fedora Silverblue (or more accurately the sway spin Fedora Sericea). Overall I’ve found it to be a good experience and I’ve succeeded at getting bits of this together using docker files and a mixture of ansible with builtin ansible modules and some bash commands to either podman, toolbx, or flatpak. But with so many tools and half a dozen semantics and formats it starts to feel pretty kludgy, brittle and like I’m doing something wrong. Particularly because I’m trying to keep the system up to date without having to always fully rebuild containers, constantly wasting cycles and internet bandwidth. As I’ve explored the space more it seems like Helm charts are more like where I’m trying to go, but it looks a bit to me like that doesn’t really have any mechanism to deploy gui or desktop applications or services and doesn’t really work with podman (though that may or may not be an issue).

I’ve also looked into Nix, and played with Guix, and distrobox and while guix is pretty nearly exactly what I’m imagining (I do particularly love the lisp based system definition) but otherwise seems too early days to be really what I need for a daily driver.

Has anyone had any experience doing something similar, or am I on some sort of fool’s errand with this?

Linux is modular, fully reproducible, free and text-based. Done :slight_smile:

Try different distro’s, like Funtoo, Devuan or Arch. Heck, even Slackware and LFS (Linux from scratch, for the uninitiated) are on the table, as modern multi-core CPU’s make building them a lot less time consuming!

Number of Linux distro’s: 351
:speech_balloon: There’s too many distro’s, we must unite them all!
:speech_balloon: Yeah, great idea! But I don’t like your solution, I’ll do it myself!
Number of Linux distro’s: 354
:roll_eyes:

Moral of the story: don’t reinvent the wheel, it’s already there, ready to roll whichever way you want. :globe_with_meridians:

“Particularly because I’m trying to keep the system up to date without having to always fully rebuild containers”

how else would you update container based solutions?? the closest I got to serenity was a derivative of helm charts called juju charms… and it supported GUI apps … but I cannot recommend it much … under the hood you have to use LXD and I do a lot of DevOps and ML stuff… much better to go with Kubernetes + Helm as you mentioned… no reason you cannot do GUI apps in a container… you simply need line of sight to port fortward X11 I imagine…

but if you’ve tried NixOS what more do you need?

1 Like

TrueNAS Scale?

Have a look at Yocto Linux. Easiest way to make your very own distro builds, reproducible over and over!

What’s wrong with Nix? It seems like it’s exactly what you’re looking for, and it’s been around for ages, so it’s not like it’s a beta project.

My daily driver is NixOS. Largely great. But when you exceed your skills, it gets really hard.

Yeah, that’s why I dropped it. As long as my system works, I don’t really care about any of the reproducibility of it.

I chose NixOS because it is interesting after ditching Windows - I have different issues with all distros I’ve tried. It is also a learning exercise for when I had some work downtime. An alternative to Ansible, and the aim of managing a (small) fleet of machines in my homelab.

If guix wasn’t so hell bent on the free software angle, I’d probably use it, but NixOS seems to me to be the best approach to fully reproducible currently (and none are perfect!)

I suppose this is true. So do you imagine doing much of this via bash scripts? I suppose you could side step a lot of ansible by just using some bash and podman/docker with the benefit of it being right at the level of the actual tools themselves with no abstraction above it, but you’d lose some of the nice things of ansible like idempotency unless you did some clever business…

juju charms sounds a lot like what I was hoping for, too bad it doesn’t exactly pan out. As for kubernetes I think I’ll have to revisit, I suppose maybe I’m just too inexperienced to have understood how to make gui applications work in it.

Actually Truecharts for TrueNAS scale was what me my realize that helm charts were pretty darn close to what I was hoping for, but again my own inexperience limited me.

I very much agree with this sentiment. I love the principle of it but I’m also not a master dev and so I’m not able to get Guix up to where I need it for personal use. I haven’t actually spent much time with Nix largely just reading about it and seeing how people use it, but maybe I made some unwarranted conclusions, and I should revisit it…

Debian has a time machine for repos.

I found that it be the easiest way to build reproducible while is images without building software by myself.

I just save my "apt install … " commands into a text file and store it on my GitHub or BitBucket, along with all the other commands used for common configuration tasks

the actual config files, like everything under /etc, I either store in a private BitBucket or backup to the local file server

“fully reproducible OS” becomes less and less important, especially for home systems, the more you stop customizing things. Leave your OS as close as possible to stock. Any customizations you want, do them from the command line and just save your commands and even your bash history. Need to reproduce the system? Just copy/paste in the commands again. Its so easy that its not worth the effort to engineer some more complicated system to handle something that you are only gonna do once or twice a year.

for services, use Docker Compose and keep the docker compose yaml file saved in a git repo as well.

2 Likes