Added cyclone-ibis
This commit is contained in:
parent
ce8da9e0ca
commit
526f3c7727
11
default.nix
Normal file
11
default.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{ sourcePaths ? import ./nix/sources.nix
|
||||
, system ? builtins.currentSystem
|
||||
, crossSystem ? null
|
||||
, config ? {}
|
||||
}@args: with import ./nix args; {
|
||||
shell = mkShell {
|
||||
buildInputs = [ niv nixops nix ];
|
||||
NIX_PATH = "nixpkgs=${path}";
|
||||
NIXOPS_DEPLOYMENT = "${globals.deploymentName}";
|
||||
};
|
||||
}
|
47
roles/cyclone-ibis.nix
Normal file
47
roles/cyclone-ibis.nix
Normal file
|
@ -0,0 +1,47 @@
|
|||
# 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";
|
||||
sha256 = "1jya2gsidv05gwh9fi8kp1cz9jdg0rsq5s1vm3y4khbgbskpb3ah";
|
||||
}) { nixpkgs = pkgs; };
|
||||
webdomain = "cycloneibis.com";
|
||||
|
||||
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 = "${cyclone-ibis}"; # Wesbite root
|
||||
};
|
||||
"www.${webdomain}" = { # Respect our elders :-)
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations."/".extraConfig = "return 301 $scheme://${webdomain}$request_uri;";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
security.acme.certs = {
|
||||
"${webdomain}".email = "admin@${webdomain}";
|
||||
"www.${webdomain}".email = "admin@${webdomain}";
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||
|
||||
}
|
Loading…
Reference in a new issue