Quake 3 Arena Dedicated Server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
quakeflake/nixos-modules/quake3ded.nix

34 lines
935 B

{ pkgs, config, lib, self, ... }:
with pkgs;
{
services.quake3-server = {
enable = true;
openFirewall = true;
baseq3 = self.packages.${pkgs.system}.baseq3;
extraConfig = ''
exec "ctc-tdm.cfg"
'';
};
systemd.services.q3ds = {
environment.HOME = lib.mkForce (
pkgs.runCommand "quake3-home" {} ''
mkdir -p $out/.q3a/baseq3
for file in ${config.services.quake3-server.baseq3}/*; do
ln -s $file $out/.q3a/baseq3/$(basename $file)
done
ln -s ${self.packages.${pkgs.system}.q3ctc} $out/.q3a/q3ctc
ln -s ${pkgs.writeText "q3ds-extra.cfg" ''
set net_port ${builtins.toString config.services.quake3-server.port}
${config.services.quake3-server.extraConfig}
''} $out/.q3a/baseq3/nix.cfg
''
);
serviceConfig.ExecStart = lib.mkForce "${pkgs.ioquake3}/ioq3ded.x86_64 +set fs_game q3ctc +exec nix.cfg";
};
}