2020-10-13 11:44:45 +00:00
|
|
|
# NixOps configuration for deploying the mcwhirter.io website
|
2022-03-07 14:26:15 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: let
|
2024-09-28 04:06:46 +00:00
|
|
|
#sources = import ../nix/sources.nix;
|
|
|
|
#mcwhirter-io = import sources.mcwhirter-io {};
|
2020-10-13 11:44:45 +00:00
|
|
|
webdomain = "mcwhirter.io";
|
|
|
|
in {
|
|
|
|
environment.sessionVariables = {
|
|
|
|
LOCALE_ARCHIVE = "/run/current-system/sw/lib/locale/locale-archive";
|
|
|
|
};
|
|
|
|
|
|
|
|
services.nginx = {
|
2021-11-16 04:57:23 +00:00
|
|
|
enable = true; # Enable Nginx
|
|
|
|
recommendedGzipSettings = true;
|
|
|
|
recommendedOptimisation = true;
|
2020-10-13 11:44:45 +00:00
|
|
|
recommendedProxySettings = true;
|
2021-11-16 04:57:23 +00:00
|
|
|
recommendedTlsSettings = true;
|
2020-10-13 11:44:45 +00:00
|
|
|
virtualHosts = {
|
2022-03-07 14:26:15 +00:00
|
|
|
"${webdomain}" = {
|
|
|
|
# website hostname
|
2021-11-16 04:57:23 +00:00
|
|
|
enableACME = true; # Use ACME certs
|
|
|
|
forceSSL = true; # Force SSL
|
2024-09-28 04:06:46 +00:00
|
|
|
#root = "${mcwhirter-io}"; # Wesbite root
|
2020-10-13 11:44:45 +00:00
|
|
|
};
|
2022-03-07 14:26:15 +00:00
|
|
|
"www.${webdomain}" = {
|
|
|
|
# Respect our elders :-)
|
|
|
|
locations."/".extraConfig = "return 301 $scheme://${webdomain}$request_uri;";
|
2020-10-13 11:44:45 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
security.acme = {
|
|
|
|
acceptTerms = true;
|
|
|
|
certs = {
|
|
|
|
"${webdomain}" = {
|
|
|
|
email = "admin@${webdomain}";
|
2021-06-07 12:22:24 +00:00
|
|
|
group = "matrix-synapse";
|
2020-10-13 11:44:45 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-03-07 14:26:15 +00:00
|
|
|
networking.firewall.allowedTCPPorts = [80 443];
|
2020-10-13 11:44:45 +00:00
|
|
|
}
|