diff --git a/deploy.sh b/deploy.sh index ea18557..66330f5 100644 --- a/deploy.sh +++ b/deploy.sh @@ -384,14 +384,25 @@ services_generation() { local j=0 for service in "${SELECTED_SERVICES[@]}"; do if [[ "${service}" != "virtualization" ]]; then - j=$((j + 1)) - cp templates/nix-config/podman/${service}.nix final-nix-config/etc/nixos/podman/${service}.nix - PODMAN_NETWORKS+=" \${pkgs.podman}/bin/podman network create --driver=bridge --subnet=172.16.${j}.0/24 --ip-range=172.16.${j}.0/24 --gateway=172.16.${j}.254 ${service}_backend"$'\n' - PODMAN_NETWORKS+=" \${pkgs.podman}/bin/podman network create --driver=bridge --subnet=172.16.${j}0.0/24 --ip-range=172.16.${j}0.0/24 --gateway=172.16.${j}0.254 ${service}_frontend"$'\n' - TRAEFIK_NETWORKS+=" ${service}_frontend:"$'\n' - TRAEFIK_NETWORKS+=" ipv4_address: 172.16.${j}0.253"$'\n' - TRAEFIK_REF_NETWORKS+=" ${service}_frontend:"$'\n' - TRAEFIK_REF_NETWORKS+=" external: true"$'\n' + if [[ "${service}" == "nextcloud" ]]; then + cp templates/nix-config/podman/${service}.nix final-nix-config/etc/nixos/podman/${service}.nix + PODMAN_NETWORKS+=" \${pkgs.podman}/bin/podman network create --driver=bridge --subnet=172.16.${j}0.0/24 --ip-range=172.16.${j}0.0/24 --gateway=172.16.${j}0.254 nextcloud-aio"$'\n' + TRAEFIK_NETWORKS+=" nextcloud-aio:"$'\n' + TRAEFIK_NETWORKS+=" ipv4_address: 172.16.${j}0.253"$'\n' + TRAEFIK_REF_NETWORKS+=" nextcloud-aio:"$'\n' + TRAEFIK_REF_NETWORKS+=" external: true"$'\n' + elif [[ "${service}" == "nextcloud" ]]; then + : + else + j=$((j + 1)) + cp templates/nix-config/podman/${service}.nix final-nix-config/etc/nixos/podman/${service}.nix + PODMAN_NETWORKS+=" \${pkgs.podman}/bin/podman network create --driver=bridge --subnet=172.16.${j}.0/24 --ip-range=172.16.${j}.0/24 --gateway=172.16.${j}.254 ${service}_backend"$'\n' + PODMAN_NETWORKS+=" \${pkgs.podman}/bin/podman network create --driver=bridge --subnet=172.16.${j}0.0/24 --ip-range=172.16.${j}0.0/24 --gateway=172.16.${j}0.254 ${service}_frontend"$'\n' + TRAEFIK_NETWORKS+=" ${service}_frontend:"$'\n' + TRAEFIK_NETWORKS+=" ipv4_address: 172.16.${j}0.253"$'\n' + TRAEFIK_REF_NETWORKS+=" ${service}_frontend:"$'\n' + TRAEFIK_REF_NETWORKS+=" external: true"$'\n' + fi fi if [[ "${service}" == "frigate" ]]; then local FRIGATE_DEVICES_BLOCK="" diff --git a/templates/nix-config/podman/gitea.nix b/templates/nix-config/podman/gitea.nix index f8a7ad6..8976140 100644 --- a/templates/nix-config/podman/gitea.nix +++ b/templates/nix-config/podman/gitea.nix @@ -15,7 +15,7 @@ in '' services: gitea: - image: gitea/gitea:latest + image: docker.io/gitea/gitea:latest container_name: gitea networks: gitea_frontend: diff --git a/templates/nix-config/podman/home-assistant.nix b/templates/nix-config/podman/home-assistant.nix index ca396fc..71e1455 100644 --- a/templates/nix-config/podman/home-assistant.nix +++ b/templates/nix-config/podman/home-assistant.nix @@ -19,13 +19,13 @@ in image: ghcr.io/home-assistant/home-assistant:latest container_name: home-assistant networks: - hass_frontend: - hass_backend: + home-assistant_frontend: + home-assistant_backend: volumes: - ${config_dir_1}:/config - /etc/localtime:/etc/localtime:ro - /run/dbus:/run/dbus:ro - # --- hass devices --- # + # --- home-assistant devices --- # labels: - traefik.enable=true - traefik.http.services.home-assistant.loadbalancer.server.port=8123 @@ -41,15 +41,15 @@ in container_name: mqtt user: 1000:1000 networks: - hass_backend: + home-assistant_backend: volumes: - ${config_dir_2}:/mosquitto restart: unless-stopped networks: - hass_backend: + home-assistant_backend: external: true - hass_frontend: + home-assistant_frontend: external: true ''; systemd.services.${container_name} = { diff --git a/templates/nix-config/podman/it-tools.nix b/templates/nix-config/podman/it-tools.nix index 495b7a7..edcb6c7 100644 --- a/templates/nix-config/podman/it-tools.nix +++ b/templates/nix-config/podman/it-tools.nix @@ -17,7 +17,7 @@ in container_name: it-tools image: corentinth/it-tools networks: - it-tools: + it-tools_frontend: labels: - traefik.enable=true - traefik.http.services.it-tools.loadbalancer.server.port=80 @@ -28,7 +28,7 @@ in - traefik.http.routers.it-tools-https.tls.certresolver=cloudflare restart: unless-stopped networks: - it-tools: + it-tools_frontend: external: true ''; diff --git a/templates/nix-config/podman/pi-hole.nix b/templates/nix-config/podman/pi-hole.nix index a3b0c68..b51aa25 100644 --- a/templates/nix-config/podman/pi-hole.nix +++ b/templates/nix-config/podman/pi-hole.nix @@ -18,7 +18,7 @@ in image: pihole/pihole:latest container_name: pi-hole networks: - pihole: + pihole_frontend: ports: # DNS Ports - "53:53/tcp" @@ -57,7 +57,7 @@ in restart: unless-stopped networks: - pihole: + pihole_frontend: external: true ''; systemd.services.${container_name} = {