feat: new wiki domain

This commit is contained in:
silver 2024-07-09 22:12:41 +01:00
parent b7cb7eeade
commit b6b9ae0579
Signed by: silver
GPG key ID: 54E2C71918E93B74
3 changed files with 57 additions and 13 deletions

View file

@ -25,7 +25,6 @@ in {
services.skynet.acme.domains = [
"discord.skynet.ie"
"public.skynet.ie"
"renew.skynet.ie"
];
services.skynet.dns.records = [
@ -45,11 +44,6 @@ in {
r_type = "CNAME";
value = config.services.skynet.host.name;
}
{
record = "renew";
r_type = "CNAME";
value = config.services.skynet.host.name;
}
];
services.nginx = {
@ -82,13 +76,6 @@ in {
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"}";
};
};
};
};

View file

@ -0,0 +1,55 @@
{
config,
pkgs,
lib,
inputs,
...
}:
with lib; let
name = "wiki";
cfg = config.services.skynet."${name}";
in {
imports = [
];
options.services.skynet."${name}" = {
enable = mkEnableOption "Skynet Wiki";
};
config = mkIf cfg.enable {
services.skynet.acme.domains = [
"renew.skynet.ie"
"wiki.skynet.ie"
];
services.skynet.dns.records = [
{
record = "renew";
r_type = "CNAME";
value = config.services.skynet.host.name;
}
{
record = "wiki";
r_type = "CNAME";
value = config.services.skynet.host.name;
}
];
services.nginx = {
virtualHosts = {
"wiki.skynet.ie" = {
forceSSL = true;
useACMEHost = "skynet";
root = "${inputs.skynet_website_renew.defaultPackage."x86_64-linux"}";
};
# redirect old links to the new wiki
"renew.skynet.ie" = {
forceSSL = true;
useACMEHost = "skynet";
locations."/".return = "307 https://wiki.skynet.ie";
};
};
};
};
}

View file

@ -26,6 +26,7 @@ Notes:
in {
imports = [
../applications/skynet.ie/skynet.ie.nix
../applications/skynet.ie/wiki.nix
];
deployment = {
@ -40,5 +41,6 @@ in {
host = host;
backup.enable = true;
website.enable = true;
wiki.enable = true;
};
}