diff --git a/systems/palatine-hill/docker/archiveteam.nix b/systems/palatine-hill/docker/archiveteam.nix index e962111..b06f0be 100644 --- a/systems/palatine-hill/docker/archiveteam.nix +++ b/systems/palatine-hill/docker/archiveteam.nix @@ -98,7 +98,10 @@ let }; container-spec = container-name: container: { image = "atdr.meo.ws/archiveteam/${container}"; - extraOptions = [ "--stop-signal=SIGINT" ]; + extraOptions = [ + "--restart=unless-stopped" + "--stop-signal=SIGINT" + ]; labels = { "com.centurylinklabs.watchtower.enable" = "true"; "com.centurylinklabs.watchtower.scope" = "archiveteam"; diff --git a/systems/palatine-hill/docker/default.nix b/systems/palatine-hill/docker/default.nix index 7853fa5..626a6a6 100644 --- a/systems/palatine-hill/docker/default.nix +++ b/systems/palatine-hill/docker/default.nix @@ -16,9 +16,6 @@ virtualisation.oci-containers.backend = "docker"; virtualisation.docker.daemon.settings.data-root = "/var/lib/docker2"; - # "rlcraft-mc-1 itzg/minecraft-server:java8" - # "mc-router-mc-router-1 itzg/mc-router" - # "restic-grafana-1 grafana/grafana:latest" # "restic-prometheus-1 prom/prometheus:latest" # "restic-restserver-1 restic/rest-server:latest" @@ -31,6 +28,8 @@ # "glances-glances-1 nicolargo/glances:latest-full" # "foundry felddy/foundryvtt:11" + # automatedFFDL + # "Qbit ghcr.io/linuxserver/qbittorrent:latest" # "Qbitvpn binhex/arch-qbittorrentvpn:latest" } diff --git a/systems/palatine-hill/docker/minecraft.nix b/systems/palatine-hill/docker/minecraft.nix new file mode 100644 index 0000000..9c0e69e --- /dev/null +++ b/systems/palatine-hill/docker/minecraft.nix @@ -0,0 +1,65 @@ +{ config, lib, ... }: + +let + servers = { + atm6 = "atm6.alicehuston.xyz"; + stoneblock3 = "sb3.alicehuston.xyz"; + RAD2 = "rad.alicehuston.xyz"; + skyfactory = "sf.alicehuston.xyz"; + divinejourney = "dj.alicehuston.xyz"; + rlcraft = "rlcraft.alicehuston.xyz"; + arcanum-institute = "arcanum.alicehuston.xyz"; + }; + defaultServer = "RAD2"; + + defaultEnv = { + EULA = "true"; + TYPE = "AUTO_CURSEFORGE"; + STOP_SERVER_ANNOUNCE_DELAY = "120"; + STOP_DURATION = "600"; + SYNC_CHUNK_WRITES = "false"; + USE_AIKAR_FLAGS = "true"; + MEMORY = "8GB"; + ALLOW_FLIGHT = "true"; + MAX_TICK_TIME = -1; + }; + + defaultOptions = [ + "--stop-signal=SIGTERM" + "--stop-timeout=30m" + "--restart=unless-stopped" + "--network=minecraft-net" + ]; +in +{ + virtualisation.oci-containers = { + mc-router = { + image = "itzg/mc-router:latest"; + extraOptions = [ + "--restart=always" + "--network=haproxy-net" + "--network=minecraft-net" + ]; + command = + "--mapping=mc.alicehuston.xyz=${defaultServer}:25565" + + (lib.mapAttrs (hostname: url: ",${url}=${hostname}:25565") servers); + }; + rlcraft = { + image = "itzg/minecraft-server:java8"; + volumes = [ + "/ZFS/ZFS-primary/games/minecraft/rlcraft/modpacks:/modpacks:ro" + "/ZFS/ZFS-primary/games/minecraft/rlcraft/data:/data" + ]; + hostname = "rlcraft"; + environment = defaultEnv // { + VERSION = "1.12.2"; + CF_SLUG = "rlcraft"; + DIFFICULTY = "hard"; + ENABLE_COMMAND_BLOCK = "true"; + }; + extraOptions = defaultOptions; + log-driver = "local"; + environmentFiles = [ config.sops.secrets.minecraft.path ]; + }; + }; +}