aboutsummaryrefslogtreecommitdiff
path: root/instance-options.nix
diff options
context:
space:
mode:
authorstuebinm2021-02-05 13:31:42 +0100
committerstuebinm2021-02-05 13:36:17 +0100
commit86c56bb9a40425e4567c3648d427ad7e6be01a65 (patch)
tree814908629b856c99dadc32773ad2dec586160cca /instance-options.nix
Functional module, extracted from fediventure repo
(just to make it easier to hack, and remove fediventure-specific deployment logic)
Diffstat (limited to 'instance-options.nix')
-rw-r--r--instance-options.nix143
1 files changed, 143 insertions, 0 deletions
diff --git a/instance-options.nix b/instance-options.nix
new file mode 100644
index 0000000..6a1d2dc
--- /dev/null
+++ b/instance-options.nix
@@ -0,0 +1,143 @@
+# Configuration options specific to a single workadventure instance.
+
+{ lib, config, ... }:
+
+with lib;
+let workadventure = import ./workadventure-nix.nix { inherit lib; };
+in
+{
+ options = rec {
+ backend = {
+ httpPort = mkOption {
+ default = 8081;
+ type = types.ints.u16;
+ description = "The TCP port the backend will bind to for http";
+ };
+
+ grpcPort = mkOption {
+ default = 50051;
+ type = types.ints.u16;
+ description = "The TCP port the backend will bind to for grpc";
+ };
+
+ package = mkOption {
+ default = workadventure.back;
+ defaultText = "third_party.workadventure-nix.back";
+ type = types.package;
+ description = "Backend package to use";
+ };
+ };
+
+ pusher = {
+ port = mkOption {
+ default = 8080;
+ type = types.ints.u16;
+ description = "The TCP port the pusher will bind to";
+ };
+
+ package = mkOption {
+ default = workadventure.pusher;
+ defaultText = "third_party.workadventure-nix.pusher";
+ type = types.package;
+ description = "Pusher package to use";
+ };
+ };
+
+ frontend = {
+ package = mkOption {
+ default = workadventure.front;
+ defaultText = "third_party.workadventure-nix.front";
+ type = types.package;
+ description = "Front package to use";
+ };
+
+ defaultMap = mkOption {
+ default = null;
+ defaultText = "not set";
+ type = types.nullOr types.str;
+ description = "The url to the default map, which will be loaded if none is given in the url. Must be a reachable url relative to the public map url defined in `maps.url`.";
+ };
+
+ urls = {
+ api = mkOption {
+ default = "/pusher";
+ type = types.str;
+ description = "The base url for the api, from the browser's point of view";
+ };
+
+ uploader = mkOption {
+ default = "/uploader";
+ type = types.str;
+ description = "The base url for the uploader, from the browser's point of view";
+ };
+
+ admin = mkOption {
+ default = "/admin";
+ type = types.str;
+ description = "The base url for the admin, from the browser's point of view";
+ };
+
+ maps = mkOption {
+ default = "/maps";
+ type = types.str;
+ description = "The base url for serving maps, from the browser's point of view";
+ };
+ };
+ };
+
+ maps = {
+ path = mkOption {
+ default = workadventure.maps.outPath + "/workadventuremaps/";
+ defaultText = "third_party.workadventure-nix.maps";
+ type = types.path;
+ description = "Maps package to use";
+ };
+ };
+
+ nginx = {
+ default = mkOption {
+ default = false;
+ type = types.bool;
+ description = "Whether this instance will be the default one served by nginx";
+ };
+
+ domain = mkOption {
+ default = null;
+ type = types.nullOr types.str;
+ description = "The domain name to serve workadenture services under. Mutually exclusive with domains.X";
+ };
+
+ serveDefaultMaps = mkOption {
+ default = true;
+ type = types.bool;
+ description = "Whether to serve the maps provided by workadventure";
+ };
+
+ domains = {
+ back = mkOption {
+ default = null;
+ type = types.nullOr types.str;
+ description = "The domain name to serve the backend under";
+ };
+
+ pusher = mkOption {
+ default = null;
+ type = types.nullOr types.str;
+ description = "The domain name to serve the pusher under";
+ };
+
+ maps = mkOption {
+ default = null;
+ type = types.nullOr types.str;
+ description = "The domain name to serve the maps under";
+ };
+
+ front = mkOption {
+ default = null;
+ type = types.nullOr types.str;
+ description = "The domain name to serve the front under";
+ };
+ };
+ };
+ };
+}