From a35281419f26b8b401273e96273ec40509b5668d Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 11 Apr 2026 14:46:04 +0000 Subject: [PATCH] Move V-Rising Docker server into game-servers.nix Consolidates V-Rising into the existing game-servers module instead of a separate file. Also uncomments the game-servers import in common.nix and adds UDP 9876/9877 to the shared firewall rules. https://claude.ai/code/session_01Ays1x4CUUJE1jPLkeNMojV --- common.nix | 3 +-- services/game-servers.nix | 35 ++++++++++++++++++++++++++++++- services/v-rising.nix | 44 --------------------------------------- 3 files changed, 35 insertions(+), 47 deletions(-) delete mode 100644 services/v-rising.nix diff --git a/common.nix b/common.nix index cedc692..18b1fc8 100644 --- a/common.nix +++ b/common.nix @@ -18,7 +18,7 @@ # Services # ./services/server-permissions.nix - #./services/game-servers.nix + ./services/game-servers.nix ./services/qbittorrent-nox.nix ./services/nginx.nix ./services/go2rtc.nix @@ -32,7 +32,6 @@ ./services/authelia.nix ./services/homepage.nix ./services/arr-interconnect.nix - ./services/v-rising.nix ]; ### Make build time quicker diff --git a/services/game-servers.nix b/services/game-servers.nix index af7d4e9..dd0635d 100644 --- a/services/game-servers.nix +++ b/services/game-servers.nix @@ -1,6 +1,39 @@ { config, pkgs, lib, ... }: { config = lib.mkIf (config.networking.hostName == "FredOS-Mediaserver") { + ## <----- V-RISING ----> ## + virtualisation.docker.enable = true; + + systemd.tmpfiles.rules = [ + "d /var/lib/v-rising 0755 root root -" + "d /var/lib/v-rising/server 0755 root root -" + "d /var/lib/v-rising/persistentdata 0755 root root -" + ]; + + virtualisation.oci-containers = { + backend = "docker"; + containers.v-rising = { + image = "trueosiris/vrising:latest"; + + volumes = [ + "/var/lib/v-rising/server:/mnt/vrising/server" + "/var/lib/v-rising/persistentdata:/mnt/vrising/persistentdata" + ]; + + ports = [ + "9876:9876/udp" + "9877:9877/udp" + ]; + + environment = { + TZ = "Europe/Stockholm"; + SERVERNAME = "FredOS V-Rising"; + WORLDNAME = "world1"; + # SERVERPASSWORD = ""; + }; + }; + }; + ## <----- HYTALE ----> ## systemd.services.hytale-server = { description = "Hytale Dedicated Server"; @@ -31,6 +64,6 @@ }; }; - networking.firewall.allowedUDPPorts = [ 5520 ]; + networking.firewall.allowedUDPPorts = [ 5520 9876 9877 ]; }; } diff --git a/services/v-rising.nix b/services/v-rising.nix deleted file mode 100644 index 045c309..0000000 --- a/services/v-rising.nix +++ /dev/null @@ -1,44 +0,0 @@ -# services/v-rising.nix — V-Rising dedicated server via Docker -{ config, lib, ... }: -{ - config = lib.mkIf (config.networking.hostName == "FredOS-Mediaserver") { - - # Docker backend for OCI containers - virtualisation.docker.enable = true; - - # Persistent data directories - systemd.tmpfiles.rules = [ - "d /var/lib/v-rising 0755 root root -" - "d /var/lib/v-rising/server 0755 root root -" - "d /var/lib/v-rising/persistentdata 0755 root root -" - ]; - - virtualisation.oci-containers = { - backend = "docker"; - containers.v-rising = { - image = "trueosiris/vrising:latest"; - - volumes = [ - "/var/lib/v-rising/server:/mnt/vrising/server" - "/var/lib/v-rising/persistentdata:/mnt/vrising/persistentdata" - ]; - - ports = [ - "9876:9876/udp" - "9877:9877/udp" - ]; - - environment = { - TZ = "Europe/Stockholm"; - SERVERNAME = "FredOS V-Rising"; - WORLDNAME = "world1"; - # Set SERVERPASSWORD via a secrets file or leave empty for public server - # SERVERPASSWORD = ""; - }; - }; - }; - - # Open firewall for V-Rising game traffic - networking.firewall.allowedUDPPorts = [ 9876 9877 ]; - }; -}