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