diff --git a/hosts/toscano.nix b/hosts/toscano.nix index d54f963..a81da2e 100644 --- a/hosts/toscano.nix +++ b/hosts/toscano.nix @@ -12,6 +12,7 @@ ../profiles/hakyll-skeleton.nix ../profiles/jfdic-web.nix ../profiles/resrok-web.nix + ../profiles/voc-web.nix ../secrets/gitea.nix ]; diff --git a/nix/sources.json b/nix/sources.json index b32acf4..4278be9 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -53,5 +53,11 @@ "type": "tarball", "url": "https://source.jfdic.org/resrok/resrok-web/archive/6f61643f8b02be9e6c0276c8286e6daba1567108.tar.gz", "url_template": "https://source.jfdic.org/resrok/resrok-web/archive/6f61643f8b02be9e6c0276c8286e6daba1567108.tar.gz" + }, + "voc-web": { + "sha256": "0f2hghgikcw4xzadsr4vvxlqc0df3cl4f8fj1l8cxmapx1ghk4mm", + "type": "tarball", + "url": "https://source.jfdic.org/voc/voc-web/archive/dad25430bad02b4d61ffab44b5989b7f72da5e3b.tar.gz", + "url_template": "https://source.jfdic.org/voc/voc-web/archive/dad25430bad02b4d61ffab44b5989b7f72da5e3b.tar.gz" } } diff --git a/profiles/voc-web.nix b/profiles/voc-web.nix new file mode 100644 index 0000000..a4d01f8 --- /dev/null +++ b/profiles/voc-web.nix @@ -0,0 +1,47 @@ +# NixOps configuration for deploying the Voices of Capricornia website + +{ config, pkgs, ... }: + +let + sources = import ../nix/sources.nix; + voc-web = import sources.voc-web { }; + webdomain = "voicesofcapricornia.org"; + +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 = { + "${webdomain}" = { # website hostname + enableACME = true; # Use ACME certs + forceSSL = true; # Force SSL + root = "${voc-web}"; # Wesbite root + }; + "www.${webdomain}" = { # Respect our elders :-) + locations."/".extraConfig = + "return 301 $scheme://${webdomain}$request_uri;"; + }; + }; + }; + + security.acme = { + acceptTerms = true; + certs = { + "${webdomain}" = { + email = "admin@${webdomain}"; + #group = "matrix-synapse"; + }; + }; + }; + + networking.firewall.allowedTCPPorts = [ 80 443 ]; + +}