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.