diff --git a/system/services/formula10.nix b/system/services/formula10.nix index e7117090..3bea1174 100644 --- a/system/services/formula10.nix +++ b/system/services/formula10.nix @@ -3,29 +3,33 @@ lib, pkgs, ... -}: { - virtualisation.oci-containers.containers.formula10 = { - image = "gitea.vps.chriphost.de/christoph/formula10:latest"; - autoStart = true; +}: let + f10Version = "latest"; +in { + virtualisation.oci-containers.containers = { + formula10 = { + image = "gitea.vps.chriphost.de/christoph/formula10:${f10Version}"; + autoStart = true; - dependsOn = []; + dependsOn = []; - ports = [ - "55555:5000" - ]; + ports = [ + "55555:5000" + ]; - volumes = [ - "formula10_data:/app/instance" - "formula10_cache:/cache" - ]; + volumes = [ + "formula10_data:/app/instance" + "formula10_cache:/cache" + ]; - environment = { - TZ = "Europe/Berlin"; + environment = { + TZ = "Europe/Berlin"; + }; + + extraOptions = [ + "--init" # Make an init process take up PID 1, to make python receive the SIGTERM + "--net=behind-nginx" + ]; }; - - extraOptions = [ - "--init" # Make an init process take up PID 1, to make python receive the SIGTERM - "--net=behind-nginx" - ]; }; } diff --git a/system/services/formula11.nix b/system/services/formula11.nix index 778b080f..8e8eafd8 100644 --- a/system/services/formula11.nix +++ b/system/services/formula11.nix @@ -3,61 +3,66 @@ lib, pkgs, ... -}: { - virtualisation.oci-containers.containers.formula11_pocketbase = { - image = "gitea.vps.chriphost.de/christoph/pocketbase:0.25.0"; - autoStart = true; +}: let + pocketbaseVersion = "0.25.0"; + f11Version = "latest"; +in { + virtualisation.oci-containers.containers = { + formula11_pocketbase = { + image = "gitea.vps.chriphost.de/christoph/pocketbase:${pocketbaseVersion}"; + autoStart = true; - dependsOn = [ - # "pihole" - ]; + dependsOn = [ + # "pihole" + ]; - ports = [ - "8090:8080" - ]; + ports = [ + "8090:8080" + ]; - volumes = [ - "formula11_pb_data:/pb/pb_data" - ]; + volumes = [ + "formula11_pb_data:/pb/pb_data" + ]; - environment = {}; + environment = {}; - extraOptions = [ - "--net=behind-nginx" - ]; - }; - - virtualisation.oci-containers.containers.formula11 = { - image = "gitea.vps.chriphost.de/christoph/formula11:latest"; - autoStart = true; - - dependsOn = [ - "formula11_pocketbase" - ]; - - ports = [ - # "8080:8090" - "5173:3000" - ]; - - volumes = []; - - environment = { - # PB_PROTOCOL="http"; - # PB_HOST="formula11_pocketbase"; - # PB_PORT="8000"; - - # PB_PROTOCOL="https"; - # PB_URL="f11pb.vps.chriphost.de"; - - PUBLIC_PBURL = "https://f11pb.vps.chriphost.de"; - - # Required by SvelteKit to prevent cross-site POST errors - ORIGIN = "https://f11.vps.chriphost.de"; + extraOptions = [ + "--net=behind-nginx" + ]; }; - extraOptions = [ - "--net=behind-nginx" - ]; + formula11 = { + image = "gitea.vps.chriphost.de/christoph/formula11:${f11Version}"; + autoStart = true; + + dependsOn = [ + "formula11_pocketbase" + ]; + + ports = [ + # "8080:8090" + "5173:3000" + ]; + + volumes = []; + + environment = { + # PB_PROTOCOL="http"; + # PB_HOST="formula11_pocketbase"; + # PB_PORT="8000"; + + # PB_PROTOCOL="https"; + # PB_URL="f11pb.vps.chriphost.de"; + + PUBLIC_PBURL = "https://f11pb.vps.chriphost.de"; + + # Required by SvelteKit to prevent cross-site POST errors + ORIGIN = "https://f11.vps.chriphost.de"; + }; + + extraOptions = [ + "--net=behind-nginx" + ]; + }; }; } diff --git a/system/services/heidi.nix b/system/services/heidi.nix index 655800a3..d9994376 100644 --- a/system/services/heidi.nix +++ b/system/services/heidi.nix @@ -3,37 +3,41 @@ lib, pkgs, ... -}: { +}: let + heidiVersion = "latest"; +in { # If we need to pass secrets to containers we can't use plain env variables. sops.templates."heidi_secrets.env".content = '' DISCORD_TOKEN=${config.sops.placeholder.heidi-discord-token} ''; - virtualisation.oci-containers.containers.heidi = { - image = "gitea.vps.chriphost.de/christoph/discord-heidi:latest"; - autoStart = true; + virtualisation.oci-containers.containers = { + heidi = { + image = "gitea.vps.chriphost.de/christoph/discord-heidi:${heidiVersion}"; + autoStart = true; - dependsOn = []; + dependsOn = []; - ports = []; + ports = []; - volumes = [ - "heidi_config:/config" + volumes = [ + "heidi_config:/config" - "/home/christoph/heidi-sounds:/sounds:ro" - ]; + "/home/christoph/heidi-sounds:/sounds:ro" + ]; - environment = { - DOCKER = "True"; + environment = { + DOCKER = "True"; + }; + + environmentFiles = [ + config.sops.templates."heidi_secrets.env".path + ]; + + extraOptions = [ + "--init" # Make an init process take up PID 1, to make python receive the SIGTERM + "--net=behind-nginx" + ]; }; - - environmentFiles = [ - config.sops.templates."heidi_secrets.env".path - ]; - - extraOptions = [ - "--init" # Make an init process take up PID 1, to make python receive the SIGTERM - "--net=behind-nginx" - ]; }; }