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