From 9c0db7e23fc3b012905e913c398cab3bdace21a7 Mon Sep 17 00:00:00 2001 From: Jordan Holt Date: Sat, 10 Jun 2023 17:29:01 +0100 Subject: [PATCH] Use pod instead of network bridge --- hosts/library/default.nix | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/hosts/library/default.nix b/hosts/library/default.nix index 7af7db7..759c34d 100644 --- a/hosts/library/default.nix +++ b/hosts/library/default.nix @@ -74,23 +74,17 @@ with lib.my; wantedBy = [ "default.target" ]; }; - systemd.services.init-container-networking = { - description = "Create a network bridge for containers on this host"; + systemd.services.podman-create-downloads-pod = { + description = "Create a pod for download-related containers on this host"; after = [ "network.target" ]; - wantedBy = [ "default.target" ]; + wantedBy = [ "podman-qbittorrent.service" ]; path = [ pkgs.zfs ]; serviceConfig.Type = "oneshot"; script = let - docker = config.virtualisation.oci-containers.backend; - dockerBin = "${pkgs.${docker}}/bin/${docker}"; + podmanBin = "${pkgs.podman}/bin/podman"; in '' - check=$(${dockerBin} network ls | grep "library-br" || true) - if [ -z "$check" ]; then - ${dockerBin} network create library-br - else - echo "library-br already exists" - fi + ${podmanBin} pod exists downloads-pod || ${podmanBin} pod create --name downloads-pod ''; }; @@ -137,7 +131,7 @@ with lib.my; ]; extraOptions = [ "--label=io.containers.autoupdate=registry" - "--network=library-br" + "--pod=downloads-pod" ]; dependsOn = [ "jellyfin" ]; }; @@ -155,7 +149,7 @@ with lib.my; ]; extraOptions = [ "--label=io.containers.autoupdate=registry" - "--network=library-br" + "--pod=downloads-pod" ]; }; radarr = { @@ -169,7 +163,7 @@ with lib.my; extraOptions = [ "--label=io.containers.autoupdate=registry" "--mount=type=bind,source=/mnt/library/movies,target=/movies" - "--network=library-br" + "--pod=downloads-pod" ]; dependsOn = [ "qbittorrent" ]; }; @@ -184,7 +178,7 @@ with lib.my; extraOptions = [ "--label=io.containers.autoupdate=registry" "--mount=type=bind,source=/mnt/library/tv,target=/tv" - "--network=library-br" + "--pod=downloads-pod" ]; dependsOn = [ "qbittorrent" ]; };