Help Deploying NixOS on Proxmox LXC

Hi, I am new to Nix (and NixOS) but am excited to be a part of this community. My self-hosted server OS is Proxmox, and I ran into issues attempting to follow the Wiki article for installing NixOS in an LXC Container.

I was mainly confused by where I should supply my own configuration.nix. Is this something I use when generating the image? Or do I do it after I boot into the OS for the first time? I am able to get into NixOS, but when attempting to place the minimal working example config and rebuild, I am unable to properly switch due to errors.

I see NixOS has a virtualization config defined for Proxmox LXC. Are these the values I should be tweaking to get the image running?

For now, I just want to reproduce what the Wiki article does. After I get that working, I hope to be able to migrate some of my apps towards a declarative NixOS environment.

1 Like

Hi @JackW and welcome to our community!

I’m not an expert of LXC on Proxmox, but I’ll try to help you.

which errors? Can you access an HTTP web page with curl or wget when you login into the container?

I think you can use them to tweak your container when you are building the image by supplying the configuration using a slightly modified build command like

$ nix run github:nix-community/nixos-generators -- --format proxmox-lxc -c /path/to/your/configuration.nix

or when your container is up and running, if it has access to the internet.

2 Likes

Thank you for the suggestion with debugging and the config. I will try again and send an update. Just wanted to acknowledge now since it will be a few days before I can proceed.