diff options
Diffstat (limited to 'nixos/sites')
-rw-r--r-- | nixos/sites/catbus-web-ui.nix | 18 | ||||
-rw-r--r-- | nixos/sites/default.nix | 10 |
2 files changed, 28 insertions, 0 deletions
diff --git a/nixos/sites/catbus-web-ui.nix b/nixos/sites/catbus-web-ui.nix new file mode 100644 index 0000000..c68cdcf --- /dev/null +++ b/nixos/sites/catbus-web-ui.nix @@ -0,0 +1,18 @@ +{ pkgs }: + +{ mosquittoHost, mosquittoPort }: { + locations = { + "/" = { + root = "${pkgs.eth.catbus-web-ui}"; + }; + + "/mqtt" = { + proxyPass = "http://${mosquittoHost}:${toString mosquittoPort}"; + proxyWebsockets = true; + extraConfig = '' + rewrite ^/mqtt$ / break; + rewrite ^/mqtt(.*)$ $1 break; + ''; + }; + }; +} diff --git a/nixos/sites/default.nix b/nixos/sites/default.nix new file mode 100644 index 0000000..1ddd148 --- /dev/null +++ b/nixos/sites/default.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: + +{ + https = site: site // { + forceSSL = true; + enableACME = true; + }; + + catbus-web-ui = pkgs.callPackage ./catbus-web-ui.nix {}; +} |