From 582e7272a568bcce09b0a487295641b3bace14f7 Mon Sep 17 00:00:00 2001 From: Malte Tammena Date: Sat, 18 Nov 2023 12:56:24 +0100 Subject: [PATCH] chore(modules): drop obsolete 7-days-to-die module --- modules/7-days-to-die.nix | 68 --------------------------------------- modules/base-system.nix | 1 - 2 files changed, 69 deletions(-) delete mode 100644 modules/7-days-to-die.nix diff --git a/modules/7-days-to-die.nix b/modules/7-days-to-die.nix deleted file mode 100644 index 0192d5f..0000000 --- a/modules/7-days-to-die.nix +++ /dev/null @@ -1,68 +0,0 @@ -{ - lib, - config, - ... -}: let - ports = { - tcp = [26900]; - udp = [26900 26901 26902]; - }; - uid = 459; - gid = 459; - cfg = config.services."7-days-to-die"; - - portsTcp = map (port: let - portStr = builtins.toString port; - in "${portStr}:${portStr}/tcp"); - portsUdp = map (port: let - portStr = builtins.toString port; - in "${portStr}:${portStr}/udp"); -in { - options.services."7-days-to-die" = with lib; { - enable = mkEnableOption "7 Days to die game server service"; - rootDir = mkOption { - type = types.str; - description = "Path to use for storage"; - }; - openFirewall = mkOption { - type = types.bool; - default = false; - description = "Whether to open the firewall for ports ${builtins.toString ports}"; - }; - }; - - config = lib.mkIf cfg.enable { - # Create the necessary user and group - users = { - groups.sdtd.gid = gid; - users.sdtd = { - inherit uid; - group = config.users.groups.sdtd.name; - isSystemUser = true; - }; - }; - - # Open the port in the firewall if requested - networking.firewall.allowedTCPPorts = lib.mkIf cfg.openFirewall ports.tcp; - networking.firewall.allowedUDPPorts = lib.mkIf cfg.openFirewall ports.udp; - - virtualisation.oci-containers.containers."7-days-to-die" = { - image = "vinanrra/7dtd-server:latest"; - ports = (portsTcp ports.tcp) ++ (portsUdp ports.udp); - environment = { - START_MODE = "1"; - PUID = builtins.toString uid; - PGID = builtins.toString gid; - TimeZone = config.time.timeZone; - BACKUP = "NO"; - }; - volumes = [ - "${cfg.rootDir}/saves:/home/sdtdserver/.local/share/7DaysToDie/" - "${cfg.rootDir}/config:/home/sdtdserver/serverfiles/" - "${cfg.rootDir}/logs:/home/sdtdserver/log/" - "${cfg.rootDir}/backups:/home/sdtdserver/lgsm/backup/" - "${cfg.rootDir}/lgsm-config:/home/sdtdserver/lgsm/lgsm-config/sdtdserver/" - ]; - }; - }; -} diff --git a/modules/base-system.nix b/modules/base-system.nix index 70b3d77..ffdd4ad 100644 --- a/modules/base-system.nix +++ b/modules/base-system.nix @@ -16,7 +16,6 @@ enableHydraMinion = config.services.openssh.enable; in { imports = [ - ./7-days-to-die.nix ./hdparm.nix ./malte.nix ./marie.nix