Nah that title already holds NixOS
Nah that title already holds NixOS
expansive repositories
That would be new for me. AFAIK Debian doesn’t have that many packages (compared to AUR or even nixpkgs (see https://repology.org/)). Regarding Flatpak: What packages do you need for a server with Flatpak? Desktop makes sense for me, but I haven’t yet had any use-case/package for server related software in Flatpak.
I switched from Debian to NixOS for servers, 3 years ago, as I think it’s easier to maintain long-term (after being on Debian on servers for years). A new install (after EOL Debian support) often is a little bit more hassle and requires a longer downtime in my experience (apart from the lack of reproducibility and declarativeness and the sheer amount of software packaged and configured in nixpkgs).
Have you tried putting it into a buildFHSUserEnv?
I also often put the “dirty” packaged AI/python stuff (which is unfortunately quite a lot) into Dockerfiles if I don’t want to package it cleanly with Nix.
Well I guess it depends how deep you’re in the rabbit hole already, I think it’s relatively easy for me at this point to create a new package (I’m maintainer already for quite a few). But yeah … steep learning curve … Less so with Nix itself, though non-the-less, it’s a simple functional programming language with a new paradigm (derivations). But rather NixOS/nixpkgs Nix magic. For example there’s a dynamic dependently typed type-system built on top of untyped Nix in the NixOS module system that is spin up on evaluation time.
But I understand your point, at the beginning of my NixOS journey I have also rather created a “good enough” Dockerfile. Depending on the exact context I still do this nowadays (often because there’s an official well maintained docker image in comparison to a not so well maintained Nix one, and the context is too complex to maintain/develop/extend it myself). But if there’s a good solution in Nix I rather use that, and that is often less headache than setting up a service with e.g. docker-compose. I also use flakes mostly for a dev environment, if you’re a little bit deeper in it, you can spin up a relatively clean dev env in short time (I’m often copy pasting the ones I have written from different projects, and change the packages/dependencies).
As I said it has a steep learning curve and documentation is pretty much the nixpkgs repo itself (well after understanding the basics of Nix and NixOS at least, with the combination of the https://nixos.wiki mostly IMO). It also takes some time to get used to the quirks of NixOS (and understanding the necessary practical design decisions of these quirks).
But I have nowadays seldom trouble with switching the generations (i.e. nixos-rebuild switch
), unless you’re updating flake inputs or (legacy) channels (where e.g. a new kernel might be used). In that case it makes sense to reboot into the new configuration. Also, obviously that can lead to short down-times (including just restarting a systemd service, if a service has changed in between the generations), if that is unacceptable, there obviously needs to be a more sophisticated solution, like kubernetes via e.g. kubnix. I’m not sure how much of that can be achieved with Ansible, as I haven’t used it that much because I disliked the “programming” capabilities of the Ansible yaml syntax (which feels kinda hacky IMHO).
But apart from NixOS, one can also just use Nix on a different system to e.g. deploy or create docker images (which can be really compact, as only the necessary dependencies for a package is packaged) that in turn could e.g. be managed with Ansible or something…
Honestly, unless you’re using Nix within something like docker images (Nix has great support for writing really minimal docker images) or use it to just build software (which is also a great use-case), I would rather go straight to NixOS, in my experience it’s a smoother experience than using Nix on a different distro and e.g. services (like standalone home-manager) .
If you’re up for it: NixOS!
It’s quite a steep learning curve, but after some time (after you’ve configured your “dream-system”) you don’t want to go back/switch to any different distro.
Specifically servers IMHO are a great use-case for NixOS. It’s usually simpler to configure than a desktop distro, and less of the usual pain points of “dirty” software (like hardcoded dynamic libraries, that exist on most systems (ubuntu as reference) at that path).
I’ve much less fear maintaining my servers with NixOS because of its declarative functional reproducability and “transactional” upgrade system, than previously (where I’ve used Debian mostly).
Skip void, try NixOS :P (my colleague switched from void too)