Updated activation script. Fixed typo.

This commit is contained in:
Raphaël Numbus
2026-01-09 10:54:31 +01:00
parent 2e1ba1c0ff
commit 2760c8b32f
3 changed files with 27 additions and 11 deletions
+2 -2
View File
@@ -386,12 +386,12 @@ services_generation() {
if [[ "${service}" != "virtualization" ]]; then if [[ "${service}" != "virtualization" ]]; then
if [[ "${service}" == "nextcloud" ]]; then 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.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+=" nextcloud-aio:"$'\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+=" nextcloud-aio:"$'\n'
TRAEFIK_REF_NETWORKS+=" external: true"$'\n' TRAEFIK_REF_NETWORKS+=" external: true"$'\n'
elif [[ "${service}" == "nextcloud" ]]; then elif [[ "${service}" == "frigate" ]]; then
: :
else else
j=$((j + 1)) j=$((j + 1))
+18 -2
View File
@@ -1,12 +1,28 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
system.activationScripts.script.text = '' systemd.services.numbus-activation = {
#!/bin/bash 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/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/config/
${pkgs.coreutils}/bin/chown -R numbus-admin:users /mnt/data/ ${pkgs.coreutils}/bin/chown -R numbus-admin:users /mnt/data/
PODMAN_NETWORKS PODMAN_NETWORKS
${pkgs.coreutils}/bin/touch /etc/numbus-server/activated.true
''; '';
};
} }
+1 -1
View File
@@ -44,7 +44,7 @@ TRAEFIK_REF_NETWORKS
systemd.services.traefik = { systemd.services.traefik = {
description = "Podman container : ${container_name}"; description = "Podman container : ${container_name}";
after = [ "network.target" ]; after = [ "network.target" "numbus-activation.service" ];
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
serviceConfig = { serviceConfig = {