From 2def5b10eb7adc943cb349f14c26b5ca5e3a2ce2 Mon Sep 17 00:00:00 2001 From: buffet Date: Wed, 5 Jun 2024 11:31:12 +0200 Subject: [PATCH] refactor: move repeated nginx snippets into one file --- hosts/ami/404.nix | 7 ------- hosts/ami/bitwarden.nix | 7 ------- hosts/ami/default.nix | 3 ++- hosts/ami/forgejo.nix | 7 ------- hosts/ami/nginx.nix | 10 ++++++++++ hosts/ami/website.nix | 7 ------- 6 files changed, 12 insertions(+), 29 deletions(-) create mode 100644 hosts/ami/nginx.nix diff --git a/hosts/ami/404.nix b/hosts/ami/404.nix index 552426a..c9ab726 100644 --- a/hosts/ami/404.nix +++ b/hosts/ami/404.nix @@ -1,12 +1,5 @@ {website, ...}: { services.nginx = { - enable = true; - - recommendedGzipSettings = true; - recommendedOptimisation = true; - recommendedProxySettings = true; - recommendedTlsSettings = true; - virtualHosts."404.buffet.sh" = { default = true; useACMEHost = "buffet.sh"; diff --git a/hosts/ami/bitwarden.nix b/hosts/ami/bitwarden.nix index ef33f98..72663da 100644 --- a/hosts/ami/bitwarden.nix +++ b/hosts/ami/bitwarden.nix @@ -15,13 +15,6 @@ in { }; nginx = { - enable = true; - - recommendedGzipSettings = true; - recommendedOptimisation = true; - recommendedProxySettings = true; - recommendedTlsSettings = true; - virtualHosts."bitwarden.buffet.sh" = { useACMEHost = "buffet.sh"; forceSSL = true; diff --git a/hosts/ami/default.nix b/hosts/ami/default.nix index a03b0a3..74b2d78 100644 --- a/hosts/ami/default.nix +++ b/hosts/ami/default.nix @@ -15,8 +15,9 @@ ./borg.nix ./disk-config.nix ./forgejo.nix - ./murmur.nix ./msmtp.nix + ./murmur.nix + ./nginx.nix ./upgrade.nix ./website.nix diff --git a/hosts/ami/forgejo.nix b/hosts/ami/forgejo.nix index eeba937..b474ad8 100644 --- a/hosts/ami/forgejo.nix +++ b/hosts/ami/forgejo.nix @@ -73,13 +73,6 @@ in { }; nginx = { - enable = true; - - recommendedGzipSettings = true; - recommendedOptimisation = true; - recommendedProxySettings = true; - recommendedTlsSettings = true; - virtualHosts."buffets.kitchen" = { useACMEHost = "buffet.sh"; forceSSL = true; diff --git a/hosts/ami/nginx.nix b/hosts/ami/nginx.nix new file mode 100644 index 0000000..6dfbb66 --- /dev/null +++ b/hosts/ami/nginx.nix @@ -0,0 +1,10 @@ +{ + services.nginx = { + enable = true; + + recommendedGzipSettings = true; + recommendedOptimisation = true; + recommendedProxySettings = true; + recommendedTlsSettings = true; + }; +} diff --git a/hosts/ami/website.nix b/hosts/ami/website.nix index b5bb3fb..46dbd15 100644 --- a/hosts/ami/website.nix +++ b/hosts/ami/website.nix @@ -2,13 +2,6 @@ networking.firewall.allowedTCPPorts = [80 443]; services.nginx = { - enable = true; - - recommendedGzipSettings = true; - recommendedOptimisation = true; - recommendedProxySettings = true; - recommendedTlsSettings = true; - virtualHosts."buffet.sh" = { useACMEHost = "buffet.sh"; forceSSL = true;