chore(modules): drop obsolete 7-days-to-die module

This commit is contained in:
Malte Tammena 2023-11-18 12:56:24 +01:00
parent 056600f24d
commit 582e7272a5
2 changed files with 0 additions and 69 deletions

View file

@ -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/"
];
};
};
}

View file

@ -16,7 +16,6 @@
enableHydraMinion = config.services.openssh.enable;
in {
imports = [
./7-days-to-die.nix
./hdparm.nix
./malte.nix
./marie.nix