From b85fbcc075584ded3b9b245843a6cf0dcfd62bdd Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Wed, 8 Jan 2025 13:43:49 +0300 Subject: [PATCH] Terraria: Add a Calamity server. --- host/x86_64-linux/home/Tandoor.nix | 3 +- host/x86_64-linux/home/Terraria.nix | 49 ++++++++++++++++------ host/x86_64-linux/home/nginx/Tandoor.nix | 1 - package/swayscript/script/NetworkWidget.sh | 2 +- 4 files changed, 39 insertions(+), 16 deletions(-) diff --git a/host/x86_64-linux/home/Tandoor.nix b/host/x86_64-linux/home/Tandoor.nix index 3847dfa..79f98b3 100644 --- a/host/x86_64-linux/home/Tandoor.nix +++ b/host/x86_64-linux/home/Tandoor.nix @@ -1,4 +1,5 @@ -{ ... }: { +{ ... }: +{ services.tandoor-recipes = { enable = true; address = "[::1]"; diff --git a/host/x86_64-linux/home/Terraria.nix b/host/x86_64-linux/home/Terraria.nix index c44f8fb..6c648cb 100644 --- a/host/x86_64-linux/home/Terraria.nix +++ b/host/x86_64-linux/home/Terraria.nix @@ -1,18 +1,41 @@ { pkgs, ... }: { - # NOTE: Admin with `tmux -S /var/lib/terraria/terraria.sock attach-session -t 0` - environment.systemPackages = with pkgs; [ tmux ]; + # Vanilla. + # NOTE: tmux -S /var/lib/terraria/terraria.sock attach-session -t 0 + # environment.systemPackages = with pkgs; [ tmux ]; + # + # services.terraria = { + # enable = true; + # autoCreatedWorldSize = "large"; + # messageOfTheDay = "<3"; + # maxPlayers = 4; + # noUPnP = false; + # openFirewall = false; + # password = "mishadima143"; + # port = 22777; + # secure = false; + # worldPath = "/var/lib/terraria/.local/share/Terraria/Worlds/World.wld"; + # }; - services.terraria = { - enable = true; - autoCreatedWorldSize = "large"; - messageOfTheDay = "<3"; - maxPlayers = 4; - noUPnP = false; - openFirewall = false; - password = "mishadima143"; - port = 22777; - secure = false; - worldPath = "/var/lib/terraria/.local/share/Terraria/Worlds/World.wld"; + # Modded. + # NOTE: docker exec tmodloader inject "say Hello World!" + virtualisation.oci-containers.containers.terraria = { + image = "jacobsmile/tmodloader1.4:latest"; + volumes = [ "/storage/hot/data/terraria_calamity:/data" ]; + ports = [ "0.0.0.0:22777:7777" ]; + environment = { + TMOD_SHUTDOWN_MESSAGE = "Goodbye! <3"; + TMOD_AUTOSAVE_INTERVAL = "5"; + # TMOD_AUTODOWNLOAD = "3015412343,2824688072,2824688266,2785100219,3222493606"; # NOTE: Comment after loading once. + TMOD_ENABLEDMODS = "3015412343,2824688072,2824688266,2785100219,3222493606"; + TMOD_MOTD = "<3"; + TMOD_PASS = "mishadima143"; + TMOD_MAXPLAYERS = "2"; + TMOD_WORLDNAME = "CWorld"; + TMOD_WORLDSIZE = "3"; + # TMOD_WORLDSEED = ""; + TMOD_DIFFICULTY = "2"; + TMOD_SECURE = "0"; + }; }; } diff --git a/host/x86_64-linux/home/nginx/Tandoor.nix b/host/x86_64-linux/home/nginx/Tandoor.nix index b2555b1..0b0f33e 100644 --- a/host/x86_64-linux/home/nginx/Tandoor.nix +++ b/host/x86_64-linux/home/nginx/Tandoor.nix @@ -21,4 +21,3 @@ ssl_dhparam /etc/letsencrypt/conf/ssl-dhparams.pem; ''; } - diff --git a/package/swayscript/script/NetworkWidget.sh b/package/swayscript/script/NetworkWidget.sh index d8b61a6..0be5d17 100644 --- a/package/swayscript/script/NetworkWidget.sh +++ b/package/swayscript/script/NetworkWidget.sh @@ -36,7 +36,7 @@ function networkwidget() { icon="󱚿" fi - if ! command -v nmcli &> /dev/null; then + if ! command -v nmcli &>/dev/null; then class="disabled" icon="󱚼" elif [[ ${internet} != "full" ]]; then