aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2024-03-15 06:45:41 +0100
committerLibravatar Alexander Foremny <aforemny@posteo.de>2024-03-15 08:48:06 +0100
commitd95b74e84eb4e71c2481ecacc309c119b8a2c447 (patch)
tree17e44946506dbcf9fd0278ba86d660840b57a266 /modules
parent63147b756c8a620b8323404ab3342f0edfa41d93 (diff)
agame: init
Diffstat (limited to 'modules')
-rw-r--r--modules/agame/default.nix13
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/agame/default.nix b/modules/agame/default.nix
new file mode 100644
index 0000000..0a8657d
--- /dev/null
+++ b/modules/agame/default.nix
@@ -0,0 +1,13 @@
+{ config, lib, pkgs, ... }:
+let cfg = config.services.agame; in
+{
+ options.services.agame.enable = lib.mkEnableOption "agame server";
+
+ config = lib.mkIf cfg.enable {
+ environment.systemPackages = [ pkgs.agame ];
+ networking.firewall.allowedUDPPorts = [ 16384 ];
+ systemd.services.agame.after = [ "network.target" ];
+ systemd.services.agame.script = "${pkgs.agame}/bin/agame --server";
+ systemd.services.agame.wantedBy = [ "multi-user.target" ];
+ };
+}