summaryrefslogtreecommitdiff
path: root/flora/services/daemoniones.nix
diff options
context:
space:
mode:
authorstuebinm2022-01-18 09:43:24 +0100
committerstuebinm2022-01-20 13:19:44 +0100
commit0bcabe1c4b1dd74af233674dfa6c6ec3011ce2c0 (patch)
tree5c58943f99245ff7f745f50b46c34ae288c3e503 /flora/services/daemoniones.nix
parentdb83a406bc6e63289e47ff5d2228c08430832655 (diff)
restructuring directories
Diffstat (limited to 'flora/services/daemoniones.nix')
-rw-r--r--flora/services/daemoniones.nix34
1 files changed, 34 insertions, 0 deletions
diff --git a/flora/services/daemoniones.nix b/flora/services/daemoniones.nix
new file mode 100644
index 0000000..ae9d3cb
--- /dev/null
+++ b/flora/services/daemoniones.nix
@@ -0,0 +1,34 @@
+{ config, pkgs, ...}:
+
+{
+ systemd.services =
+ let simpledaemon = name: command: {
+ enable = true;
+ description = name;
+ wantedBy = [ "multi-user.target" ];
+ serviceConfig.Type = "simple";
+ script = command;
+ };
+ in {
+ choclo = simpledaemon "choclo signalling server" "/root/simple-signalling/target/release/chaski -b 127.0.0.1:5000";
+ wasi = simpledaemon "wasi backend" "/root/wasi-minimal/target/release/wasi";
+# picarones = simpledaemon "picarones backend" "/root/picarones-server/target/release/picarones -b 127.0.0.1:6000";
+ };
+
+ services.nginx = {
+ virtualHosts =
+ let websocketproxy = addr: {
+ locations."/".proxyPass = addr;
+ forceSSL = true;
+ enableACME = true;
+ locations."/".proxyWebsockets = true;
+ };
+ in {
+ "wasi.stuebinm.eu" = websocketproxy "http://127.0.0.1:9000";
+ "choclo.stuebinm.eu" = websocketproxy "http://127.0.0.1:5000";
+# "picarones.stuebinm.eu" = websocketproxy "http://127.0.0.1:6000";
+ };
+ };
+
+
+}