femt: move skynet into its own subfolder
This commit is contained in:
parent
fee1e34ca8
commit
34f8f0eb8c
2 changed files with 2 additions and 5 deletions
117
applications/skynet.ie/skynet.ie.nix
Normal file
117
applications/skynet.ie/skynet.ie.nix
Normal file
|
@ -0,0 +1,117 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
name = "website";
|
||||
cfg = config.services.skynet."${name}";
|
||||
in {
|
||||
imports = [];
|
||||
|
||||
options.services.skynet."${name}" = {
|
||||
enable = mkEnableOption "Skynet Main Website";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.skynet.acme.domains = [
|
||||
# the root one is already covered by teh certificate
|
||||
"2017.skynet.ie"
|
||||
"2009.skynet.ie"
|
||||
"discord.skynet.ie"
|
||||
"public.skynet.ie"
|
||||
"renew.skynet.ie"
|
||||
];
|
||||
|
||||
services.skynet.dns.records = [
|
||||
# means root domain, so skynet.ie
|
||||
{
|
||||
record = "@";
|
||||
r_type = "A";
|
||||
value = config.services.skynet.host.ip;
|
||||
}
|
||||
{
|
||||
record = "2017";
|
||||
r_type = "CNAME";
|
||||
value = config.services.skynet.host.name;
|
||||
}
|
||||
{
|
||||
record = "2009";
|
||||
r_type = "CNAME";
|
||||
value = config.services.skynet.host.name;
|
||||
}
|
||||
{
|
||||
record = "discord";
|
||||
r_type = "CNAME";
|
||||
value = config.services.skynet.host.name;
|
||||
}
|
||||
{
|
||||
record = "public";
|
||||
r_type = "CNAME";
|
||||
value = config.services.skynet.host.name;
|
||||
}
|
||||
{
|
||||
record = "renew";
|
||||
r_type = "CNAME";
|
||||
value = config.services.skynet.host.name;
|
||||
}
|
||||
];
|
||||
|
||||
services.nginx = {
|
||||
virtualHosts = {
|
||||
# main site
|
||||
"skynet.ie" = {
|
||||
forceSSL = true;
|
||||
useACMEHost = "skynet";
|
||||
locations = {
|
||||
# this alwas points to teh current version of teh site
|
||||
"/".root = "${inputs.skynet_website_2017.defaultPackage."x86_64-linux"}";
|
||||
|
||||
# this redirects old links to new format
|
||||
"~* ~(?<username>[a-z_0-9]*)(?<files>\\S*)$" = {
|
||||
priority = 1;
|
||||
return = "307 https://$username.users.skynet.ie$files";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# 2017 to now
|
||||
"2017.skynet.ie" = {
|
||||
forceSSL = true;
|
||||
useACMEHost = "skynet";
|
||||
root = "${inputs.skynet_website_2017.defaultPackage."x86_64-linux"}";
|
||||
};
|
||||
|
||||
# archive of teh site as it was ~2009 to 2017
|
||||
"2009.skynet.ie" = {
|
||||
forceSSL = true;
|
||||
useACMEHost = "skynet";
|
||||
root = "${inputs.skynet_website_2009.defaultPackage."x86_64-linux"}";
|
||||
};
|
||||
|
||||
# a custom discord url, because we are too cheap otehrwise
|
||||
"discord.skynet.ie" = {
|
||||
forceSSL = true;
|
||||
useACMEHost = "skynet";
|
||||
locations."/".return = "307 https://discord.gg/mkuKJkCuyM";
|
||||
};
|
||||
|
||||
"public.skynet.ie" = {
|
||||
forceSSL = true;
|
||||
useACMEHost = "skynet";
|
||||
root = "${inputs.compsoc_public.packages.x86_64-linux.default}";
|
||||
locations."/".extraConfig = "autoindex on;";
|
||||
};
|
||||
|
||||
# for alumni members to renew their account
|
||||
"renew.skynet.ie" = {
|
||||
forceSSL = true;
|
||||
useACMEHost = "skynet";
|
||||
root = "${inputs.skynet_website_renew.defaultPackage."x86_64-linux"}";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue