{ lib, modulesPath, ... }: { # LXC containers share the host kernel — Proxmox starts them by exec'ing # /sbin/init directly, no bootloader/initrd involved — and Proxmox has its # own container hostname/network provisioning outside Nix. nixpkgs' own # virtualisation/proxmox-lxc.nix module already handles all of this # correctly (boot.isContainer, loader.initScript, systemd-networkd) and, # critically, provides config.system.build.tarball — a directly # `pct restore`-able container image, no nixos-install/bind-mount needed # (nixos-install refuses to touch the filesystem it's currently running # on, which is exactly what bind-mounting / onto /mnt for an installer # LXC container does). imports = [ (modulesPath + "/virtualisation/proxmox-lxc.nix") ]; proxmoxLXC = { # host.nix declares each host's real hostname (networking.hostName); # keep that instead of letting Proxmox's ambient container config win. manageHostName = true; # Unprivileged matches how these containers are actually created. privileged = false; }; boot.loader = { grub.enable = false; systemd-boot.enable = false; }; # NetworkManager depends on a running udevd to enumerate/classify devices, # which boot.isContainer disables (see nixpkgs' container-config.nix) — # that's what broke DHCP-hostname registration in Pi-hole. The imported # proxmox-lxc.nix module already switches networking to systemd-networkd # for the same reason; it just doesn't disable NetworkManager itself, # which modules/common/configuration.nix enables for every host. networking.networkmanager.enable = lib.mkForce false; }