2024-05-07 00:37:19 +00:00
|
|
|
/*
|
|
|
|
This file is for hosting teh open governance for other societies
|
|
|
|
*/
|
|
|
|
{
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
with lib; let
|
|
|
|
name = "keyserver";
|
|
|
|
cfg = config.services.skynet."${name}";
|
|
|
|
port = 11371;
|
|
|
|
in {
|
|
|
|
imports = [
|
|
|
|
../acme.nix
|
|
|
|
../dns.nix
|
|
|
|
];
|
|
|
|
|
|
|
|
options.services.skynet."${name}" = {
|
2024-05-30 16:55:29 +00:00
|
|
|
enable = mkEnableOption "Skynet Public Keyserver";
|
2024-05-07 00:37:19 +00:00
|
|
|
};
|
|
|
|
|
2024-05-30 16:55:29 +00:00
|
|
|
config = mkIf cfg.enable {
|
2024-05-30 12:34:59 +00:00
|
|
|
services.skynet.acme.domains = [
|
2024-05-07 00:37:19 +00:00
|
|
|
"${name}.skynet.ie"
|
|
|
|
];
|
|
|
|
|
2024-05-30 12:25:52 +00:00
|
|
|
services.skynet.dns.records = [
|
2024-05-07 00:37:19 +00:00
|
|
|
{
|
|
|
|
record = "${name}";
|
|
|
|
r_type = "CNAME";
|
2024-05-30 16:55:29 +00:00
|
|
|
value = config.services.skynet.host.name;
|
2024-05-07 00:37:19 +00:00
|
|
|
}
|
|
|
|
];
|
|
|
|
|
2024-05-30 12:04:44 +00:00
|
|
|
services.hockeypuck = {
|
2024-05-07 00:37:19 +00:00
|
|
|
enable = true;
|
2024-05-30 12:04:44 +00:00
|
|
|
port = port;
|
|
|
|
};
|
|
|
|
|
|
|
|
# hockeypuck needs a database backend
|
|
|
|
services.postgresql = {
|
|
|
|
enable = true;
|
|
|
|
ensureDatabases = ["hockeypuck"];
|
|
|
|
ensureUsers = [
|
|
|
|
{
|
|
|
|
name = "hockeypuck";
|
|
|
|
ensureDBOwnership = true;
|
|
|
|
}
|
|
|
|
];
|
2024-05-07 00:37:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
services.nginx.virtualHosts = {
|
|
|
|
"${name}.skynet.ie" = {
|
|
|
|
forceSSL = true;
|
|
|
|
useACMEHost = "skynet";
|
|
|
|
locations."/" = {
|
|
|
|
proxyPass = "http://localhost:${toString port}";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|