diff options
| author | seth <[email protected]> | 2023-08-24 03:57:22 -0400 |
|---|---|---|
| committer | seth <[email protected]> | 2023-08-24 04:21:43 -0400 |
| commit | 0ead9592dc3b6b8ac19b74cdc4980eef15ed78c5 (patch) | |
| tree | 5e7b5974f97436130a9230c34f4ee2b3d2521198 /parts/lib/utils/nginx.nix | |
| parent | 7cbaaa0445e7c49818acf6a30c8bd8e0a62d21c6 (diff) | |
lib/mkProxy+mkVHosts: init
Diffstat (limited to 'parts/lib/utils/nginx.nix')
| -rw-r--r-- | parts/lib/utils/nginx.nix | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/parts/lib/utils/nginx.nix b/parts/lib/utils/nginx.nix new file mode 100644 index 0000000..57be4fb --- /dev/null +++ b/parts/lib/utils/nginx.nix @@ -0,0 +1,22 @@ +{lib, ...}: let + inherit (builtins) mapAttrs; + inherit (lib) recursiveUpdate; +in { + mkProxy = endpoint: port: { + "${endpoint}" = { + proxyPass = "http://localhost:${toString port}"; + proxyWebsockets = true; + }; + }; + + mkVHosts = let + commonSettings = { + enableACME = true; + # workaround for https://github.com/NixOS/nixpkgs/issues/210807 + acmeRoot = null; + + addSSL = true; + }; + in + mapAttrs (_: recursiveUpdate commonSettings); +} |
