Files
nixos.server/modules/containers/default.nix
2026-07-30 19:41:07 +01:00

27 lines
606 B
Nix

{self, ...}: {
flake.nixosModules.containers = {config, ...}: let
modules = with self.nixosModules; [
];
in {
imports = modules;
# Runtime
virtualisation.podman = {
enable = true;
autoPrune.enable = true;
dockerCompat = true;
};
# Enable container name DNS for all Podman networks.
networking.firewall.interfaces = let
matchAll =
if !config.networking.nftables.enable
then "podman+"
else "podman*";
in {
"${matchAll}".allowedUDPPorts = [53];
};
virtualisation.oci-containers.backend = "podman";
};
}