server: podman: use nftables firewall driver

After `lpppsssy`, `networking.nat` now recreates table ip nat on each switch, evicting
netavark's published-port DNAT rules and breaking Caddy reverse proxies
to published container ports. Pin the nftables driver so rules live in
an isolated table inet netavark that NixOS never touches.
This commit is contained in:
2026-07-27 22:24:04 +08:00
parent fef9f79a78
commit ad9771d339
2 changed files with 20 additions and 14 deletions
-14
View File
@@ -1,14 +0,0 @@
{ lib, ... }:
{
virtualisation.oci-containers.backend = lib.mkForce "podman";
virtualisation.podman = {
enable = true;
dockerCompat = true;
dockerSocket.enable = true;
defaultNetwork.settings.dns_enabled = true;
};
# avoid collision with dnsmasq
virtualisation.containers = {
containersConf.settings.network.dns_bind_port = 5353;
};
}
+20
View File
@@ -0,0 +1,20 @@
{ lib, ... }:
{
virtualisation.oci-containers.backend = lib.mkForce "podman";
virtualisation.podman = {
enable = true;
dockerCompat = true;
dockerSocket.enable = true;
defaultNetwork.settings.dns_enabled = true;
};
virtualisation.containers = {
containersConf.settings.network = {
# avoid collision with dnsmasq
dns_bind_port = 5353;
# keep netavark rules in an isolated `table inet netavark` instead of the
# `table ip nat` that networking.nat recreates on each nixos-rebuild switch,
# which would otherwise evict podman's published-port DNAT rules.
firewall_driver = "nftables";
};
};
}