diff --git a/configuration.nix b/configuration.nix index 442e34b..9bb5411 100644 --- a/configuration.nix +++ b/configuration.nix @@ -7,6 +7,7 @@ in ./hardware-configuration.nix ./firewall.nix (import ./acme.nix { inherit base-domain; }) + (import ./nginx.nix { inherit base-domain; }) (import ./sourcehut.nix { inherit base-domain; }) ./userprogs.nix ]; diff --git a/nginx.nix b/nginx.nix new file mode 100644 index 0000000..b7d837e --- /dev/null +++ b/nginx.nix @@ -0,0 +1,24 @@ +{ base-domain, ... }: +{ + services.nginx = { + enable = true; + recommendedTlsSettings = true; + recommendedOptimisation = true; + recommendedGzipSettings = true; + recommendedProxySettings = true; + virtualHosts = { + "${base-domain}" = { + enableACME = true; + }; + "sourcehut.${base-domain}" = { + enableACME = true; + }; + "meta.sourcehut.${base-domain}" = { + enableACME = true; + }; + "git.sourcehut.${base-domain}" = { + enableACME = true; + }; + }; + }; +} diff --git a/sourcehut.nix b/sourcehut.nix index 2ffaec0..5dba45d 100644 --- a/sourcehut.nix +++ b/sourcehut.nix @@ -43,27 +43,5 @@ in }; }; - services.nginx = { - enable = true; - recommendedTlsSettings = true; - recommendedOptimisation = true; - recommendedGzipSettings = true; - recommendedProxySettings = true; - virtualHosts = { - "${base-domain}" = { - enableACME = true; - }; - "${fqdn}" = { - enableACME = true; - }; - "meta.${fqdn}" = { - enableACME = true; - }; - "git.${fqdn}" = { - enableACME = true; - }; - }; - }; - services.postgresql.enable = true; }