More reading:
- `nixos-rebuild` on `proxmox-lxc` container fails with `busctl` error, and causes other configuration change from base image · Issue #319 · nix-community/nixos-generators · GitHub
- `nixos-rebuild` ready image · Issue #86 · nix-community/nixos-generators · GitHub
trying to deploy NixOS onto Proxmox as an LXC using this guide
Not sure if expected or not, it seems that when building as mentioned in the guide, the container doesn’t carry the “base” config from the build OR doesn’t have permission to access that base config (which is on the host).
So when running nixos-rebuild
, it’s missing that “base” config / can’t access it.
Workarounds mentioned in posts above are suggesting to:
- recreate a new container each time you modify want to modify the
configuration.nix
(`nixos-rebuild` on `proxmox-lxc` container fails with `busctl` error, and causes other configuration change from base image · Issue #319 · nix-community/nixos-generators · GitHub) - OR
making a script, that creates a container from template tarball, runs nixinate on it with minimal config, populating the store and profiles...
(How to generate a NixOS tarball (LXC template) with all dependencies, not just runtime? - #2 by Renerick)
I’m using lxc
with lxd
and haven’t encountered such issue(s) so far.
That’s how I’m currently creating nixos
image for lxc
, possibly try with a very minimal configuration.nix
:
Something like that:
{ config, pkgs, ... }:
{
boot.isContainer = true;
system.stateVersion = "24.05";
# add some config below
}