diff options
author | Ethel Morgan <eth@ethulhu.co.uk> | 2020-07-11 13:25:55 +0100 |
---|---|---|
committer | Ethel Morgan <eth@ethulhu.co.uk> | 2020-07-11 13:25:55 +0100 |
commit | 6d189cabb27e81323881073c91714a7410efc8c3 (patch) | |
tree | 78da6880687ebe004ced097c6195667a8ef7cf46 /nixos | |
parent | 72db61a67f49b6b456496af606f8c3ef3959c9fe (diff) |
add sites package, add sites.catbus-web-ui
Diffstat (limited to 'nixos')
-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 {}; +} |