Try to get services up and running

This commit is contained in:
Raphaël Numbus
2026-01-09 08:15:10 +01:00
parent 99e4c5d0c1
commit 2e1ba1c0ff
5 changed files with 30 additions and 19 deletions
+19 -8
View File
@@ -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=""
+1 -1
View File
@@ -15,7 +15,7 @@ in
''
services:
gitea:
image: gitea/gitea:latest
image: docker.io/gitea/gitea:latest
container_name: gitea
networks:
gitea_frontend:
@@ -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} = {
+2 -2
View File
@@ -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
'';
+2 -2
View File
@@ -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} = {