summaryrefslogtreecommitdiff
path: root/lib/nginx.nix
diff options
context:
space:
mode:
Diffstat (limited to 'lib/nginx.nix')
-rw-r--r--lib/nginx.nix61
1 files changed, 0 insertions, 61 deletions
diff --git a/lib/nginx.nix b/lib/nginx.nix
deleted file mode 100644
index 5cf829b..0000000
--- a/lib/nginx.nix
+++ /dev/null
@@ -1,61 +0,0 @@
-{ lib, ... }:
-
-{
- /**
- Create an NGINX virtualHost submodule proxying a local port
-
- # Example
-
- ```nix
- mkProxy "/" "3000"
- => {
- proxyPass = "http://localhost:3000";
- proxyWebsockets = true;
- }
- ```
-
- # Type
-
- ```
- mkProxy :: String -> Number -> AttrSet
- ```
-
- # Arguments
-
- - [endpoint] virtualHost endpoint that `port` will be proxied towards
- - [port] Port to be proxied
- */
- mkProxy = endpoint: port: {
- "${endpoint}" = {
- proxyPass = "http://localhost:${toString port}";
- proxyWebsockets = true;
- };
- };
-
- /**
- Transform the names of an attribute set of nginx virtualHosts into a full subdomain
-
- # Example
-
- ```nix
- toVHosts "example.com" {
- subdomain = { };
- }
- => {
- "subdomain.example.com" = { };
- }
- ```
-
- # Type
-
- ```
- toVHosts :: String -> AttrSet -> AttrSet
- ```
-
- # Arguments
-
- - [domain] Root domain used
- - [subdomainMap] A name value pair of subdomains and their virtualHost options
- */
- toVHosts = domain: lib.mapAttrs' (name: lib.nameValuePair "${name}.${domain}");
-}