aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--modules/agame/default.nix13
-rw-r--r--nix/sources.json6
-rw-r--r--pkgs/agame/default.nix7
-rw-r--r--systems/system1/configuration.nix5
4 files changed, 31 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" ];
+ };
+}
diff --git a/nix/sources.json b/nix/sources.json
index 8c5ac7a..654686a 100644
--- a/nix/sources.json
+++ b/nix/sources.json
@@ -5,6 +5,12 @@
"rev": "9f2d5ae570c120f19434f03eb20ab2c3ecf36e0c",
"type": "git"
},
+ "agame": {
+ "branch": "main",
+ "repo": "git@code.nomath.org:~/agame",
+ "rev": "1e162629da53373f0e2502014d42c7636412e67e",
+ "type": "git"
+ },
"feed-nomath-org": {
"branch": "main",
"repo": "git@code.nomath.org:~/feed-nomath-org",
diff --git a/pkgs/agame/default.nix b/pkgs/agame/default.nix
new file mode 100644
index 0000000..97e0de7
--- /dev/null
+++ b/pkgs/agame/default.nix
@@ -0,0 +1,7 @@
+{}:
+let
+ sources = import ../../nix/sources.nix;
+ # note: uses nixpkgs-unstable
+ pkgs = import (import "${sources.agame}/nix/sources.nix").nixpkgs { };
+in
+pkgs.callPackage "${sources.agame}/agame.nix" { }
diff --git a/systems/system1/configuration.nix b/systems/system1/configuration.nix
index 2502212..1ac4b4b 100644
--- a/systems/system1/configuration.nix
+++ b/systems/system1/configuration.nix
@@ -7,6 +7,7 @@
../../configs
# TODO auto-load modules
../../modules/abuilder
+ ../../modules/agame
../../modules/fysiweb-capabilities
../../modules/fysiweb-secrets
];
@@ -90,5 +91,9 @@
{
fysiweb-apps.public.grafana.grafana-nomath-org.domain = "grafana.nomath.org";
}
+ # enable agame server
+ {
+ services.agame.enable = true;
+ }
];
}