Use pod instead of network bridge
This commit is contained in:
@ -74,23 +74,17 @@ with lib.my;
|
|||||||
wantedBy = [ "default.target" ];
|
wantedBy = [ "default.target" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.init-container-networking = {
|
systemd.services.podman-create-downloads-pod = {
|
||||||
description = "Create a network bridge for containers on this host";
|
description = "Create a pod for download-related containers on this host";
|
||||||
after = [ "network.target" ];
|
after = [ "network.target" ];
|
||||||
wantedBy = [ "default.target" ];
|
wantedBy = [ "podman-qbittorrent.service" ];
|
||||||
|
|
||||||
path = [ pkgs.zfs ];
|
path = [ pkgs.zfs ];
|
||||||
serviceConfig.Type = "oneshot";
|
serviceConfig.Type = "oneshot";
|
||||||
script = let
|
script = let
|
||||||
docker = config.virtualisation.oci-containers.backend;
|
podmanBin = "${pkgs.podman}/bin/podman";
|
||||||
dockerBin = "${pkgs.${docker}}/bin/${docker}";
|
|
||||||
in ''
|
in ''
|
||||||
check=$(${dockerBin} network ls | grep "library-br" || true)
|
${podmanBin} pod exists downloads-pod || ${podmanBin} pod create --name downloads-pod
|
||||||
if [ -z "$check" ]; then
|
|
||||||
${dockerBin} network create library-br
|
|
||||||
else
|
|
||||||
echo "library-br already exists"
|
|
||||||
fi
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -137,7 +131,7 @@ with lib.my;
|
|||||||
];
|
];
|
||||||
extraOptions = [
|
extraOptions = [
|
||||||
"--label=io.containers.autoupdate=registry"
|
"--label=io.containers.autoupdate=registry"
|
||||||
"--network=library-br"
|
"--pod=downloads-pod"
|
||||||
];
|
];
|
||||||
dependsOn = [ "jellyfin" ];
|
dependsOn = [ "jellyfin" ];
|
||||||
};
|
};
|
||||||
@ -155,7 +149,7 @@ with lib.my;
|
|||||||
];
|
];
|
||||||
extraOptions = [
|
extraOptions = [
|
||||||
"--label=io.containers.autoupdate=registry"
|
"--label=io.containers.autoupdate=registry"
|
||||||
"--network=library-br"
|
"--pod=downloads-pod"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
radarr = {
|
radarr = {
|
||||||
@ -169,7 +163,7 @@ 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"
|
||||||
"--network=library-br"
|
"--pod=downloads-pod"
|
||||||
];
|
];
|
||||||
dependsOn = [ "qbittorrent" ];
|
dependsOn = [ "qbittorrent" ];
|
||||||
};
|
};
|
||||||
@ -184,7 +178,7 @@ 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"
|
||||||
"--network=library-br"
|
"--pod=downloads-pod"
|
||||||
];
|
];
|
||||||
dependsOn = [ "qbittorrent" ];
|
dependsOn = [ "qbittorrent" ];
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user