Currently, my homelab is a 3 node proxmox cluster with 99% of the apps deployed into lxc containers.
I use ansible to bootstrap the environment with some common settings and then I mostly make manual changes as needed by the application.
A friend has been using Nix for his infra and at work, we recently switched to Nix from a mix of shell scripts & makefiles for the dev environments. This made me look into nix and check if maybe it’ll work for my homelab.
A couple of points:
I do not want to use NixOS at all. I don’t want to move my apps from proxmox to NixOS, nor am I going to run Proxmox in NixOS.
I am primarily interested in reducing the manual work and bootstrapping + configuring the containers and VMs for all the apps using Nix.
The current ansible setup is also slightly brittle and I want to try something else anyway, does nix make sense for my use case?
I tried to create a basic config today and deploy it with deploy-rs. I am just starting out but it’s a frustrating experience. deploy-rs documentation is very inadequate and when I search for anything, I get search results related to Nix with NixOS
Could you clarify a little? All of the system level tools are going to target the nixos “api” for controlling the system-level state. So it seems you’ll want to keep using ansible for targetting inventory. Then the question becomes how do you want to use nix? I don’t know anything about lxc containers. I know that you can use pkgs.dockerTools to build oci images, but I don’t know of equivalent for lxc. Honestly the focus of the nix community at large is (imo):
Use nix to build applications as nix store paths
Consume those applications using NixOS
Enable desktop environments to consume (1)
I don’t know of any projects tackling what you want. So I’d say unless you want to consume a ton of documentation, become somewhat expert in nix, and write your own deployment tool, I would say no, nix is not for you.
The jankiest thing I can think of would be to have a pre-canned ubuntu image with nix installed and use something like comin to pull stuff automatically and build it. Of course you can’t use comin, because it assumes nixos. But you could just have some top level nix expression that builds your expression. See here for some discussion of something like that.
EDIT: I guess one thing I want to say because maybe this post is too flat “No”, is that I had a chance to get aboard the nix train around 10 years earlier than I did when I came across it in the haskell community, and it looked weird and annoying and of all the technologies I dismissed out of hand it’s the one I regret the hardest. Take that for what you will