feat: skynet 2016 is live!
This commit is contained in:
parent
2ea0dc0d6b
commit
1c33c78c50
2 changed files with 63 additions and 23 deletions
55
applications/skynet.ie.nix
Normal file
55
applications/skynet.ie.nix
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
{ config, pkgs, lib, inputs, ... }:
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.services.skynet;
|
||||||
|
in {
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
./acme.nix
|
||||||
|
./dns.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
options.services.skynet = {
|
||||||
|
host = {
|
||||||
|
ip = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
};
|
||||||
|
name = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
skynet_dns.records = [
|
||||||
|
# means root domain, so skynet.ie
|
||||||
|
{record="@"; r_type="A"; value=cfg.host.ip;}
|
||||||
|
{record="2016"; r_type="CNAME"; value="skynet.ie";}
|
||||||
|
];
|
||||||
|
|
||||||
|
networking.firewall.allowedTCPPorts = [80 443];
|
||||||
|
services.httpd = {
|
||||||
|
enable = true;
|
||||||
|
group = "acme";
|
||||||
|
|
||||||
|
virtualHosts = {
|
||||||
|
# main site
|
||||||
|
"skynet.ie" = {
|
||||||
|
forceSSL = true;
|
||||||
|
useACMEHost = "skynet";
|
||||||
|
documentRoot = "${inputs.skynet_website.defaultPackage."x86_64-linux"}";
|
||||||
|
# only on skynet.ie
|
||||||
|
# skynet.ie/~username
|
||||||
|
enableUserDir = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# archive of teh site as it was ~2012 to 2016
|
||||||
|
"2016.skynet.ie" = {
|
||||||
|
forceSSL = true;
|
||||||
|
useACMEHost = "skynet";
|
||||||
|
documentRoot = "${inputs.skynet_website_2016.defaultPackage."x86_64-linux"}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -22,7 +22,7 @@ let
|
||||||
|
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
../applications/acme.nix
|
../applications/skynet.ie.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
deployment = {
|
deployment = {
|
||||||
|
@ -35,13 +35,10 @@ in {
|
||||||
|
|
||||||
# it has two network devices so two
|
# it has two network devices so two
|
||||||
skynet_dns.records = [
|
skynet_dns.records = [
|
||||||
{record=name; r_type="A"; value=ip_pub; server=true;}
|
#{record=name; r_type="A"; value=ip_pub; server=true;}
|
||||||
|
{record=name; r_type="A"; value=ip_priv; server=true;}
|
||||||
{record="${name}.int"; r_type="A"; value=ip_priv; server=true;}
|
{record="${name}.int"; r_type="A"; value=ip_priv; server=true;}
|
||||||
|
|
||||||
# change to pub later
|
|
||||||
{record="@"; r_type="A"; value=ip_priv;}
|
|
||||||
|
|
||||||
{record=ip_pub; r_type="PTR"; value=hostname;}
|
|
||||||
{record=ip_priv; r_type="PTR"; value=hostname_int;}
|
{record=ip_priv; r_type="PTR"; value=hostname_int;}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -69,22 +66,10 @@ in {
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [80 443];
|
services.skynet = {
|
||||||
services.httpd = {
|
host = {
|
||||||
enable = true;
|
ip = ip_priv;
|
||||||
group = "acme";
|
name = name;
|
||||||
|
|
||||||
virtualHosts = {
|
|
||||||
# main site
|
|
||||||
"skynet.ie" = {
|
|
||||||
forceSSL = true;
|
|
||||||
useACMEHost = "skynet";
|
|
||||||
|
|
||||||
documentRoot = "${inputs.skynet_website.defaultPackage."x86_64-linux"}";
|
|
||||||
|
|
||||||
# skynet.ie/~username
|
|
||||||
enableUserDir = true;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
Loading…
Reference in a new issue