Try to get services up and running
This commit is contained in:
@@ -384,14 +384,25 @@ services_generation() {
|
|||||||
local j=0
|
local j=0
|
||||||
for service in "${SELECTED_SERVICES[@]}"; do
|
for service in "${SELECTED_SERVICES[@]}"; do
|
||||||
if [[ "${service}" != "virtualization" ]]; then
|
if [[ "${service}" != "virtualization" ]]; then
|
||||||
j=$((j + 1))
|
if [[ "${service}" == "nextcloud" ]]; then
|
||||||
cp templates/nix-config/podman/${service}.nix final-nix-config/etc/nixos/podman/${service}.nix
|
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 nextcloud-aio"$'\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+=" nextcloud-aio:"$'\n'
|
||||||
TRAEFIK_NETWORKS+=" ${service}_frontend:"$'\n'
|
TRAEFIK_NETWORKS+=" ipv4_address: 172.16.${j}0.253"$'\n'
|
||||||
TRAEFIK_NETWORKS+=" ipv4_address: 172.16.${j}0.253"$'\n'
|
TRAEFIK_REF_NETWORKS+=" nextcloud-aio:"$'\n'
|
||||||
TRAEFIK_REF_NETWORKS+=" ${service}_frontend:"$'\n'
|
TRAEFIK_REF_NETWORKS+=" external: true"$'\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
|
fi
|
||||||
if [[ "${service}" == "frigate" ]]; then
|
if [[ "${service}" == "frigate" ]]; then
|
||||||
local FRIGATE_DEVICES_BLOCK=""
|
local FRIGATE_DEVICES_BLOCK=""
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ in
|
|||||||
''
|
''
|
||||||
services:
|
services:
|
||||||
gitea:
|
gitea:
|
||||||
image: gitea/gitea:latest
|
image: docker.io/gitea/gitea:latest
|
||||||
container_name: gitea
|
container_name: gitea
|
||||||
networks:
|
networks:
|
||||||
gitea_frontend:
|
gitea_frontend:
|
||||||
|
|||||||
@@ -19,13 +19,13 @@ in
|
|||||||
image: ghcr.io/home-assistant/home-assistant:latest
|
image: ghcr.io/home-assistant/home-assistant:latest
|
||||||
container_name: home-assistant
|
container_name: home-assistant
|
||||||
networks:
|
networks:
|
||||||
hass_frontend:
|
home-assistant_frontend:
|
||||||
hass_backend:
|
home-assistant_backend:
|
||||||
volumes:
|
volumes:
|
||||||
- ${config_dir_1}:/config
|
- ${config_dir_1}:/config
|
||||||
- /etc/localtime:/etc/localtime:ro
|
- /etc/localtime:/etc/localtime:ro
|
||||||
- /run/dbus:/run/dbus:ro
|
- /run/dbus:/run/dbus:ro
|
||||||
# --- hass devices --- #
|
# --- home-assistant devices --- #
|
||||||
labels:
|
labels:
|
||||||
- traefik.enable=true
|
- traefik.enable=true
|
||||||
- traefik.http.services.home-assistant.loadbalancer.server.port=8123
|
- traefik.http.services.home-assistant.loadbalancer.server.port=8123
|
||||||
@@ -41,15 +41,15 @@ in
|
|||||||
container_name: mqtt
|
container_name: mqtt
|
||||||
user: 1000:1000
|
user: 1000:1000
|
||||||
networks:
|
networks:
|
||||||
hass_backend:
|
home-assistant_backend:
|
||||||
volumes:
|
volumes:
|
||||||
- ${config_dir_2}:/mosquitto
|
- ${config_dir_2}:/mosquitto
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
hass_backend:
|
home-assistant_backend:
|
||||||
external: true
|
external: true
|
||||||
hass_frontend:
|
home-assistant_frontend:
|
||||||
external: true
|
external: true
|
||||||
'';
|
'';
|
||||||
systemd.services.${container_name} = {
|
systemd.services.${container_name} = {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ in
|
|||||||
container_name: it-tools
|
container_name: it-tools
|
||||||
image: corentinth/it-tools
|
image: corentinth/it-tools
|
||||||
networks:
|
networks:
|
||||||
it-tools:
|
it-tools_frontend:
|
||||||
labels:
|
labels:
|
||||||
- traefik.enable=true
|
- traefik.enable=true
|
||||||
- traefik.http.services.it-tools.loadbalancer.server.port=80
|
- traefik.http.services.it-tools.loadbalancer.server.port=80
|
||||||
@@ -28,7 +28,7 @@ in
|
|||||||
- traefik.http.routers.it-tools-https.tls.certresolver=cloudflare
|
- traefik.http.routers.it-tools-https.tls.certresolver=cloudflare
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
networks:
|
networks:
|
||||||
it-tools:
|
it-tools_frontend:
|
||||||
external: true
|
external: true
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ in
|
|||||||
image: pihole/pihole:latest
|
image: pihole/pihole:latest
|
||||||
container_name: pi-hole
|
container_name: pi-hole
|
||||||
networks:
|
networks:
|
||||||
pihole:
|
pihole_frontend:
|
||||||
ports:
|
ports:
|
||||||
# DNS Ports
|
# DNS Ports
|
||||||
- "53:53/tcp"
|
- "53:53/tcp"
|
||||||
@@ -57,7 +57,7 @@ in
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
pihole:
|
pihole_frontend:
|
||||||
external: true
|
external: true
|
||||||
'';
|
'';
|
||||||
systemd.services.${container_name} = {
|
systemd.services.${container_name} = {
|
||||||
|
|||||||
Reference in New Issue
Block a user