2023-05-09 13:54:45 +00:00
|
|
|
# NixOS configuration for deploying the Reciproka Kolectiva website
|
2022-07-21 06:08:50 +00:00
|
|
|
{
|
|
|
|
self,
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: let
|
2023-04-29 13:42:43 +00:00
|
|
|
flake = builtins.getFlake (toString ../.);
|
|
|
|
hakyll-skeleton = import flake.inputs.hakyll-skeleton {};
|
2023-05-09 13:54:45 +00:00
|
|
|
webdomain = "skeleton.reciproka.co";
|
2021-11-18 00:16:34 +00:00
|
|
|
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:08:50 +00:00
|
|
|
"${webdomain}" = {
|
|
|
|
# website hostname
|
2021-11-18 00:16:34 +00:00
|
|
|
enableACME = true; # Use ACME certs
|
|
|
|
forceSSL = true; # Force SSL
|
|
|
|
root = "${hakyll-skeleton}"; # Wesbite root
|
|
|
|
};
|
2022-07-21 06:08:50 +00:00
|
|
|
"www.${webdomain}" = {
|
|
|
|
# Respect our elders :-)
|
|
|
|
locations."/".extraConfig = "return 301 $scheme://${webdomain}$request_uri;";
|
2021-11-18 00:16:34 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
security.acme = {
|
|
|
|
acceptTerms = true;
|
2022-07-21 06:08:50 +00:00
|
|
|
certs = {"${webdomain}" = {email = "admin@${webdomain}";};};
|
2021-11-18 00:16:34 +00:00
|
|
|
};
|
|
|
|
|
2022-07-21 06:08:50 +00:00
|
|
|
networking.firewall.allowedTCPPorts = [80 443];
|
2021-11-18 00:16:34 +00:00
|
|
|
}
|