aboutsummaryrefslogtreecommitdiffstats
path: root/modules/agame/default.nix
blob: 0a8657d0fa2cb000ee467909e6f87703ac87d436 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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" ];
  };
}