reciproka-ops/profiles/voc-web.nix

48 lines
1.1 KiB
Nix
Raw Permalink Normal View History

2021-11-25 22:41:01 +00:00
# NixOps configuration for deploying the Voices of Capricornia website
2022-07-21 06:00:18 +00:00
{
self,
config,
inputs,
pkgs,
...
}: let
voc-web = import inputs.voc-web {};
2021-11-25 22:41:01 +00:00
webdomain = "voicesofcapricornia.org";
in {
environment.sessionVariables = {
LOCALE_ARCHIVE = "/run/current-system/sw/lib/locale/locale-archive";
};
services.nginx = {
enable = true; # Enable Nginx
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
virtualHosts = {
2022-07-21 06:00:18 +00:00
"${webdomain}" = {
# website hostname
2021-11-25 22:41:01 +00:00
enableACME = true; # Use ACME certs
forceSSL = true; # Force SSL
root = "${voc-web}"; # Wesbite root
};
2022-07-21 06:00:18 +00:00
"www.${webdomain}" = {
# Respect our elders :-)
locations."/".extraConfig = "return 301 $scheme://${webdomain}$request_uri;";
2021-11-25 22:41:01 +00:00
};
};
};
security.acme = {
acceptTerms = true;
certs = {
"${webdomain}" = {
email = "admin@${webdomain}";
#group = "matrix-synapse";
};
};
};
2022-07-21 06:00:18 +00:00
networking.firewall.allowedTCPPorts = [80 443];
2021-11-25 22:41:01 +00:00
}