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 = [ allowedTCPPorts = [
22 # SSH 22 # SSH
]; ];
interfaces."podman+" = {
allowedUDPPorts = [ 53 ];
allowedTCPPorts = [ 53 ];
};
}; };
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
@ -74,22 +78,9 @@ with lib.my;
wantedBy = [ "default.target" ]; 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 = { virtualisation.podman = {
enable = true; enable = true;
defaultNetwork.settings.dns_enabled = true;
extraPackages = [ pkgs.zfs ]; extraPackages = [ pkgs.zfs ];
}; };
@ -131,7 +122,6 @@ with lib.my;
]; ];
extraOptions = [ extraOptions = [
"--label=io.containers.autoupdate=registry" "--label=io.containers.autoupdate=registry"
"--pod=downloads-pod"
]; ];
dependsOn = [ "jellyfin" ]; dependsOn = [ "jellyfin" ];
}; };
@ -149,7 +139,6 @@ with lib.my;
]; ];
extraOptions = [ extraOptions = [
"--label=io.containers.autoupdate=registry" "--label=io.containers.autoupdate=registry"
"--pod=downloads-pod"
]; ];
}; };
radarr = { radarr = {
@ -163,7 +152,6 @@ with lib.my;
extraOptions = [ extraOptions = [
"--label=io.containers.autoupdate=registry" "--label=io.containers.autoupdate=registry"
"--mount=type=bind,source=/mnt/library/movies,target=/movies" "--mount=type=bind,source=/mnt/library/movies,target=/movies"
"--pod=downloads-pod"
]; ];
dependsOn = [ "qbittorrent" ]; dependsOn = [ "qbittorrent" ];
}; };
@ -178,7 +166,6 @@ with lib.my;
extraOptions = [ extraOptions = [
"--label=io.containers.autoupdate=registry" "--label=io.containers.autoupdate=registry"
"--mount=type=bind,source=/mnt/library/tv,target=/tv" "--mount=type=bind,source=/mnt/library/tv,target=/tv"
"--pod=downloads-pod"
]; ];
dependsOn = [ "qbittorrent" ]; dependsOn = [ "qbittorrent" ];
}; };