Updated activation script. Fixed typo.
This commit is contained in:
@@ -386,18 +386,18 @@ services_generation() {
|
||||
if [[ "${service}" != "virtualization" ]]; then
|
||||
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'
|
||||
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
|
||||
elif [[ "${service}" == "frigate" ]]; 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'
|
||||
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'
|
||||
|
||||
@@ -1,12 +1,28 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
system.activationScripts.script.text = ''
|
||||
#!/bin/bash
|
||||
${pkgs.coreutils}/bin/mkdir -p /mnt/config/ /mnt/data/
|
||||
${pkgs.coreutils}/bin/chown -R numbus-admin:users /mnt/config/
|
||||
${pkgs.coreutils}/bin/chown -R numbus-admin:users /mnt/data/
|
||||
systemd.services.numbus-activation = {
|
||||
description = "Numbus Server Activation";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" "local-fs.target" ];
|
||||
serviceConfig = {
|
||||
User = "numbus-admin";
|
||||
Environment = [ "XDG_RUNTIME_DIR=/run/user/1000" ];
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
};
|
||||
script = ''
|
||||
if [[ -e /etc/numbus-server/activated.true ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
${pkgs.coreutils}/bin/mkdir -p /mnt/config/ /mnt/data/
|
||||
${pkgs.coreutils}/bin/chown -R numbus-admin:users /mnt/config/
|
||||
${pkgs.coreutils}/bin/chown -R numbus-admin:users /mnt/data/
|
||||
|
||||
PODMAN_NETWORKS
|
||||
'';
|
||||
|
||||
${pkgs.coreutils}/bin/touch /etc/numbus-server/activated.true
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -44,7 +44,7 @@ TRAEFIK_REF_NETWORKS
|
||||
|
||||
systemd.services.traefik = {
|
||||
description = "Podman container : ${container_name}";
|
||||
after = [ "network.target" ];
|
||||
after = [ "network.target" "numbus-activation.service" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
serviceConfig = {
|
||||
|
||||
Reference in New Issue
Block a user