Is Nix the right solution for my setup?

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):

  1. Use nix to build applications as nix store paths
  2. Consume those applications using NixOS
  3. 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 :slight_smile: