mio-ops/profiles/cyclone-ibis.nix

53 lines
1.5 KiB
Nix
Raw Normal View History

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