chore: move nginx configuration to own file

This commit is contained in:
Khaïs COLIN 2024-08-22 16:55:59 +00:00
parent 8412cb21d7
commit 8099b6bf9c
3 changed files with 25 additions and 22 deletions

View file

@ -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
];

24
nginx.nix Normal file
View file

@ -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;
};
};
};
}

View file

@ -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;
}