From 9f7b46f9472d6d99edec7ee1bc195d48fd5a0035 Mon Sep 17 00:00:00 2001 From: prescientmoon Date: Fri, 11 Oct 2024 16:32:48 +0200 Subject: [PATCH] Fix 5d-diplomacy volume and build setup --- .../nixos/lapetus/services/5d-diplomacy/default.nix | 11 +++++++++++ .../lapetus/services/5d-diplomacy/generated.nix | 13 +++---------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/hosts/nixos/lapetus/services/5d-diplomacy/default.nix b/hosts/nixos/lapetus/services/5d-diplomacy/default.nix index f2687f8..ef66130 100644 --- a/hosts/nixos/lapetus/services/5d-diplomacy/default.nix +++ b/hosts/nixos/lapetus/services/5d-diplomacy/default.nix @@ -3,7 +3,18 @@ imports = [ ./generated.nix ]; satellite.cloudflared.at.dip.port = config.satellite.ports."5d-diplomacy"; + virtualisation.oci-containers.containers."5d-diplomacy-frontend".ports = [ "${toString config.satellite.ports."5d-diplomacy"}:8080" ]; + + virtualisation.oci-containers.containers."5d-diplomacy-mssql".volumes = + let + dataDir = "/persist/state/var/lib/5d-diplomacy"; + in + [ + "${dataDir}/mssql-data/data:/var/opt/mssql/data:rw" + "${dataDir}/mssql-data/log:/var/opt/mssql/log:rw" + "${dataDir}/mssql-data/secrets:/var/opt/mssql/secrets:rw" + ]; } diff --git a/hosts/nixos/lapetus/services/5d-diplomacy/generated.nix b/hosts/nixos/lapetus/services/5d-diplomacy/generated.nix index e3d11f3..48f8def 100644 --- a/hosts/nixos/lapetus/services/5d-diplomacy/generated.nix +++ b/hosts/nixos/lapetus/services/5d-diplomacy/generated.nix @@ -2,6 +2,7 @@ { pkgs, lib, ... }: { + # Containers virtualisation.oci-containers.containers."5d-diplomacy-backend" = { image = "localhost/compose2nix-5d-diplomacy-backend"; @@ -34,7 +35,6 @@ }; virtualisation.oci-containers.containers."5d-diplomacy-frontend" = { image = "localhost/compose2nix-5d-diplomacy-frontend"; - ports = [ "127.0.0.1:5173:8080/tcp" ]; log-driver = "journald"; extraOptions = [ "--network-alias=frontend" @@ -65,11 +65,6 @@ "ACCEPT_EULA" = "y"; "MSSQL_SA_PASSWORD" = "Passw0rd@"; }; - volumes = [ - "/home/moon/projects/5d-diplomacy-with-multiverse-time-travel/mssql-data/data:/var/opt/mssql/data:rw" - "/home/moon/projects/5d-diplomacy-with-multiverse-time-travel/mssql-data/log:/var/opt/mssql/log:rw" - "/home/moon/projects/5d-diplomacy-with-multiverse-time-travel/mssql-data/secrets:/var/opt/mssql/secrets:rw" - ]; user = "root"; log-driver = "journald"; extraOptions = [ @@ -114,8 +109,7 @@ TimeoutSec = 300; }; script = '' - cd /home/moon/projects/5d-diplomacy-with-multiverse-time-travel/server - docker build -t compose2nix-5d-diplomacy-backend . + docker build -t compose2nix-5d-diplomacy-backend https://github.com/Oliveriver/5d-diplomacy-with-multiverse-time-travel.git:server ''; partOf = [ "docker-compose-5d-diplomacy-root.target" ]; wantedBy = [ "docker-compose-5d-diplomacy-root.target" ]; @@ -131,8 +125,7 @@ TimeoutSec = 300; }; script = '' - cd /home/moon/projects/5d-diplomacy-with-multiverse-time-travel/client - docker build -t compose2nix-5d-diplomacy-frontend . + docker build -t compose2nix-5d-diplomacy-frontend https://github.com/Oliveriver/5d-diplomacy-with-multiverse-time-travel.git:client ''; partOf = [ "docker-compose-5d-diplomacy-root.target" ]; wantedBy = [ "docker-compose-5d-diplomacy-root.target" ];