diff options
| author | Seth Flynn <[email protected]> | 2025-02-08 14:10:33 -0500 |
|---|---|---|
| committer | Seth Flynn <[email protected]> | 2025-02-08 15:17:18 -0500 |
| commit | 9db83aab18d17eebeea667938ba3a49b2207451e (patch) | |
| tree | 23915b055f5bf3766a7716b5ba219cc85da46ebb | |
| parent | 0790e72af536821ab862ccef2ae2038dd9cef33a (diff) | |
lib: drop
I don't really need these nginx functions
| -rw-r--r-- | README.md | 4 | ||||
| -rw-r--r-- | flake.nix | 1 | ||||
| -rw-r--r-- | lib/default.nix | 11 | ||||
| -rw-r--r-- | lib/nginx.nix | 61 | ||||
| -rw-r--r-- | systems/atlas/nginx.nix | 14 |
5 files changed, 7 insertions, 84 deletions
@@ -18,10 +18,6 @@ greasy taco i love Pieces meant for maintaining this flake -## lib/ - -Small functions I like to use around here - ## modules/ Sets of modules meant for NixOS and @@ -22,7 +22,6 @@ inputs.getchpkgs.flakeModules.configurations ./flake - ./lib ./modules ./openwrt ./systems diff --git a/lib/default.nix b/lib/default.nix deleted file mode 100644 index d7fb959..0000000 --- a/lib/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ lib, ... }: - -{ - flake.lib = lib.makeExtensible ( - final: - - lib.mapAttrs (lib.const (lib.flip import { inherit lib final; })) { - nginx = ./nginx.nix; - } - ); -} 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}"); -} diff --git a/systems/atlas/nginx.nix b/systems/atlas/nginx.nix index bdd3cc3..57c2b0f 100644 --- a/systems/atlas/nginx.nix +++ b/systems/atlas/nginx.nix @@ -1,12 +1,12 @@ -{ config, inputs, ... }: -let - inherit (inputs.self.lib.nginx) mkProxy toVHosts; -in +{ config, ... }: + { services.nginx = { - virtualHosts = toVHosts config.networking.domain { - miniflux = { - locations = mkProxy "/" "7000"; + virtualHosts = { + "miniflux.getchoo.com" = { + locations."/" = { + proxyPass = "http://${config.services.miniflux.config.LISTEN_ADDR}"; + }; }; }; }; |
