mio-ops/profiles/cyclone-ibis.nix

53 lines
1.4 KiB
Nix
Raw Normal View History

2020-05-10 22:17:06 +00:00
# NixOps configuration for deploying the Cyclone Ibis website
2022-03-07 14:26:15 +00:00
{
config,
pkgs,
...
}: let
2020-05-10 22:17:06 +00:00
cyclone-ibis = import (pkgs.fetchgit {
2021-11-16 04:57:23 +00:00
name = "cyclone-ibis-src";
url = "https://source.mcwhirter.io/craige/cyclone-ibis.git";
2021-06-07 05:58:33 +00:00
branchName = "consensus";
2021-12-22 10:48:50 +00:00
sha256 = "sha256-NIEs0EuiHL9Zll0Sa4aR5zyzerw5akXxSC1pkDQPG5s=";
2022-03-07 14:26:15 +00:00
}) {nixpkgs = pkgs;};
2020-05-10 22:17:06 +00:00
webdomain = "cycloneibis.com";
in {
environment.sessionVariables = {
LOCALE_ARCHIVE = "/run/current-system/sw/lib/locale/locale-archive";
};
2021-11-16 04:57:23 +00:00
nixpkgs.config.allowBroken = true; # Hakyll is marked as broken in 20.09
2020-12-31 01:55:41 +00:00
2020-05-10 22:17:06 +00:00
services.nginx = {
2021-11-16 04:57:23 +00:00
enable = true; # Enable Nginx
recommendedGzipSettings = true;
recommendedOptimisation = true;
2020-05-10 22:17:06 +00:00
recommendedProxySettings = true;
2021-11-16 04:57:23 +00:00
recommendedTlsSettings = true;
2020-05-10 22:17:06 +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
root = "${cyclone-ibis}"; # Wesbite root
2020-05-10 22:17:06 +00:00
};
2022-03-07 14:26:15 +00:00
"www.${webdomain}" = {
# Respect our elders :-)
2020-05-10 22:17:06 +00:00
forceSSL = true;
enableACME = true;
2022-03-07 14:26:15 +00:00
locations."/".extraConfig = "return 301 $scheme://${webdomain}$request_uri;";
2020-05-10 22:17:06 +00:00
};
};
};
2020-09-17 01:13:58 +00:00
security.acme = {
acceptTerms = true;
certs = {
2021-11-16 04:57:23 +00:00
"${webdomain}".email = "admin@${webdomain}";
2020-09-17 01:13:58 +00:00
"www.${webdomain}".email = "admin@${webdomain}";
};
2020-05-10 22:17:06 +00:00
};
2022-03-07 14:26:15 +00:00
networking.firewall.allowedTCPPorts = [80 443];
2020-05-10 22:17:06 +00:00
}