upvote
NixOS is great on bare metal when you can do that, and you have the political and practical support. But if you don't, Nix is also a great way to build container images, especially with https://github.com/nlewo/nix2container

Shipping a bunch of immutable store paths packed into container blobs is a very natural fit for Nix, and Nix gives you a great incremental build/storage story if you have a monorepo or something monorepo-shaped that is too expensive to just do from scratch every time. And of course, having that interface plugs you into the whole modern ecosystem of k8s, devcontainer, agentic whatever.

Like I say, I like NixOS on metal too, but Nix containers are a great way to get a bunch of the benefits.

reply
Agreed. We can't use it work yet, mainly because the teams aren't familiar. I'm planning to introduce it in some of our ML workflows, since that team doesn't care about the infrastructure as long as it works.

Nix is orthogonal to k3s though. k3s is great for container orchestration, with features like zero-downtime rolling updates & rollbacks, a built-in ingress controller and load balancer, sophisticated health checking (liveness, readiness, startup) that integrates with the previous two features, automatic manifest-driven updates, fine-grained container-level firewall, first-class support for managing and automatically mounting configurations and secrets in containers, RBAC for granular permissions, and job scheduling.

Docker Compose supports almost none of that out of the box, and the features where there is some overlap, like config files and secrets, are more primitive and depend on host machine files rather than managed resources.

reply