summaryrefslogtreecommitdiff
path: root/hosts
diff options
context:
space:
mode:
Diffstat (limited to 'hosts')
-rw-r--r--hosts/atlas/nginx.nix34
-rw-r--r--hosts/p-body/nginx.nix34
2 files changed, 16 insertions, 52 deletions
diff --git a/hosts/atlas/nginx.nix b/hosts/atlas/nginx.nix
index fa06dc3..cdf483d 100644
--- a/hosts/atlas/nginx.nix
+++ b/hosts/atlas/nginx.nix
@@ -1,9 +1,10 @@
{
config,
- lib,
+ self,
...
}: let
inherit (config.networking) domain;
+ inherit (self.lib.utils.nginx) mkVHosts mkProxy;
in {
server = {
acme.enable = true;
@@ -18,33 +19,14 @@ in {
recommendedProxySettings = true;
recommendedTlsSettings = true;
- virtualHosts = let
- mkProxy = endpoint: port: {
- "${endpoint}" = {
- proxyPass = "http://localhost:${port}";
- proxyWebsockets = true;
- };
+ virtualHosts = mkVHosts {
+ "miniflux.${domain}" = {
+ locations = mkProxy "/" "7000";
};
- mkVHosts = let
- commonSettings = {
- enableACME = true;
- # workaround for https://github.com/NixOS/nixpkgs/issues/210807
- acmeRoot = null;
-
- addSSL = true;
- };
- in
- builtins.mapAttrs (_: lib.recursiveUpdate commonSettings);
- in
- mkVHosts {
- "miniflux.${domain}" = {
- locations = mkProxy "/" "7000";
- };
-
- "msix.${domain}" = {
- root = "/var/www/msix";
- };
+ "msix.${domain}" = {
+ root = "/var/www/msix";
};
+ };
};
}
diff --git a/hosts/p-body/nginx.nix b/hosts/p-body/nginx.nix
index d413b5d..d52473c 100644
--- a/hosts/p-body/nginx.nix
+++ b/hosts/p-body/nginx.nix
@@ -1,9 +1,10 @@
{
config,
- lib,
+ self,
...
}: let
inherit (config.networking) domain;
+ inherit (self.lib.utils.nginx) mkProxy mkVHosts;
in {
server = {
acme.enable = true;
@@ -18,33 +19,14 @@ in {
recommendedProxySettings = true;
recommendedTlsSettings = true;
- virtualHosts = let
- mkProxy = endpoint: port: {
- "${endpoint}" = {
- proxyPass = "http://localhost:${port}";
- proxyWebsockets = true;
- };
+ virtualHosts = mkVHosts {
+ "api.${domain}" = {
+ locations = mkProxy "/" "8080";
};
- mkVHosts = let
- commonSettings = {
- enableACME = true;
- # workaround for https://github.com/NixOS/nixpkgs/issues/210807
- acmeRoot = null;
-
- addSSL = true;
- };
- in
- builtins.mapAttrs (_: lib.recursiveUpdate commonSettings);
- in
- mkVHosts {
- "api.${domain}" = {
- locations = mkProxy "/" "8080";
- };
-
- "grafana.${domain}" = {
- locations = mkProxy "/" "4000";
- };
+ "grafana.${domain}" = {
+ locations = mkProxy "/" "4000";
};
+ };
};
}