Fix container networking

This commit is contained in:
2023-06-10 18:09:13 +01:00
parent 9c0db7e23f
commit 247b6c2c1a

View File

@ -18,6 +18,10 @@ with lib.my;
allowedTCPPorts = [
22 # SSH
];
interfaces."podman+" = {
allowedUDPPorts = [ 53 ];
allowedTCPPorts = [ 53 ];
};
};
networking.networkmanager.enable = true;
@ -74,22 +78,9 @@ with lib.my;
wantedBy = [ "default.target" ];
};
systemd.services.podman-create-downloads-pod = {
description = "Create a pod for download-related containers on this host";
after = [ "network.target" ];
wantedBy = [ "podman-qbittorrent.service" ];
path = [ pkgs.zfs ];
serviceConfig.Type = "oneshot";
script = let
podmanBin = "${pkgs.podman}/bin/podman";
in ''
${podmanBin} pod exists downloads-pod || ${podmanBin} pod create --name downloads-pod
'';
};
virtualisation.podman = {
enable = true;
defaultNetwork.settings.dns_enabled = true;
extraPackages = [ pkgs.zfs ];
};
@ -131,7 +122,6 @@ with lib.my;
];
extraOptions = [
"--label=io.containers.autoupdate=registry"
"--pod=downloads-pod"
];
dependsOn = [ "jellyfin" ];
};
@ -149,7 +139,6 @@ with lib.my;
];
extraOptions = [
"--label=io.containers.autoupdate=registry"
"--pod=downloads-pod"
];
};
radarr = {
@ -163,7 +152,6 @@ with lib.my;
extraOptions = [
"--label=io.containers.autoupdate=registry"
"--mount=type=bind,source=/mnt/library/movies,target=/movies"
"--pod=downloads-pod"
];
dependsOn = [ "qbittorrent" ];
};
@ -178,7 +166,6 @@ with lib.my;
extraOptions = [
"--label=io.containers.autoupdate=registry"
"--mount=type=bind,source=/mnt/library/tv,target=/tv"
"--pod=downloads-pod"
];
dependsOn = [ "qbittorrent" ];
};