diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/agame/default.nix | 13 |
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" ]; + }; +} |