diff --git a/flake.lock b/flake.lock index 018b202..a7ba9f0 100644 --- a/flake.lock +++ b/flake.lock @@ -54,11 +54,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1635141467, - "narHash": "sha256-H+TVE6tBSm4nAepm7HRfW7AcrndI5e4+TJwCQo4/z+s=", + "lastModified": 1635587056, + "narHash": "sha256-2RzriuQ8OEvY+wRUTpCgIiNNuFukKa7CiEAA0b2gsew=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "38d21595b8fb0a744aa31c5794013bf42cf98fa9", + "rev": "e49cd51ebcbb916e2481555aad8d9548807e9d12", "type": "github" }, "original": { diff --git a/hosts/nginx/configuration.nix b/hosts/nginx/configuration.nix index 44b2ea3..85f0630 100644 --- a/hosts/nginx/configuration.nix +++ b/hosts/nginx/configuration.nix @@ -3,8 +3,16 @@ # and in the NixOS manual (accessible by running ‘nixos-help’). { config, pkgs, ... }: - -{ +let + k8s_proxy = { + enableACME = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://10.42.42.150:8000/"; + proxyWebsockets = true; + }; + }; +in { imports = [ # Import common config ../../common/generic-lxc.nix @@ -31,7 +39,6 @@ recommendedProxySettings = true; recommendedTlsSettings = true; - virtualHosts."ha.0x76.dev" = { enableACME = true; forceSSL = true; @@ -41,33 +48,10 @@ }; }; - # TODO: Make a function for adding hostnames to k8s endpoint(s). - virtualHosts."zookeeper.0x76.dev" = { - enableACME = true; - forceSSL = true; - locations."/" = { - proxyPass = "http://10.42.42.150:8000/"; - proxyWebsockets = true; - }; - }; - - virtualHosts."wooloofan.club" = { - enableACME = true; - forceSSL = true; - locations."/" = { - proxyPass = "http://10.42.42.150:8000/"; - proxyWebsockets = true; - }; - }; - - virtualHosts."whoami.wooloofan.club" = { - enableACME = true; - forceSSL = true; - locations."/" = { - proxyPass = "http://10.42.42.150:8000/"; - proxyWebsockets = true; - }; - }; + # Kubernetes endpoints + virtualHosts."zookeeper.0x76.dev" = k8s_proxy; + virtualHosts."wooloofan.club" = k8s_proxy; + virtualHosts."whoami.wooloofan.club" = k8s_proxy; }; security.acme.email = "victorheld12@gmail.com";