2024-05-11 16:27:31 +02:00
|
|
|
{ config, inputs, ... }: {
|
2024-05-11 16:02:39 +02:00
|
|
|
imports = [
|
|
|
|
./nix-config.nix
|
|
|
|
];
|
2024-05-10 20:09:39 +02:00
|
|
|
sops.secrets."services/hydra/signKey" = {
|
|
|
|
owner = "hydra-queue-runner";
|
2024-05-11 16:27:31 +02:00
|
|
|
sopsFile = ../../../secrets/services/hydra.yaml;
|
2024-05-10 20:09:39 +02:00
|
|
|
};
|
2024-05-11 16:27:31 +02:00
|
|
|
|
2024-05-09 20:21:49 +02:00
|
|
|
services.hydra = {
|
|
|
|
enable = true;
|
|
|
|
hydraURL = "https://hydra.kyouma.net";
|
|
|
|
listenHost = "localhost";
|
|
|
|
notificationSender = "hydra@hydra.kyouma.net";
|
|
|
|
minimumDiskFree = 2;
|
|
|
|
useSubstitutes = true;
|
2024-05-10 20:09:39 +02:00
|
|
|
extraConfig = ''
|
|
|
|
binary_cache_public_uri = https://cache.kyouma.net
|
2024-05-11 17:46:14 +02:00
|
|
|
evaluator_workers = 8
|
|
|
|
evaluator_max_memory_size = 4096
|
2024-05-10 20:09:39 +02:00
|
|
|
'';
|
2024-05-09 20:21:49 +02:00
|
|
|
};
|
2024-05-11 16:27:31 +02:00
|
|
|
services.harmonia = {
|
|
|
|
enable = true;
|
|
|
|
signKeyPath = config.sops.secrets."services/hydra/signKey".path;
|
|
|
|
settings = {
|
|
|
|
bind = "[::1]:5555";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-05-11 16:02:39 +02:00
|
|
|
kyouma.nginx.defaultForbidden = "hydra.kyouma.net";
|
2024-05-10 20:09:39 +02:00
|
|
|
kyouma.nginx.virtualHosts = {
|
2024-05-11 16:27:31 +02:00
|
|
|
"hydra.kyouma.net".locations."/".proxyPass = "http://localhost:3000";
|
|
|
|
"cache.kyouma.net" = {
|
2024-05-10 20:09:39 +02:00
|
|
|
locations."/" = {
|
2024-05-11 16:27:31 +02:00
|
|
|
proxyPass = "http://[::1]:5555";
|
2024-05-10 20:09:39 +02:00
|
|
|
};
|
|
|
|
locations."= /" = {
|
2024-05-11 16:27:31 +02:00
|
|
|
return = ''200 'Public key:\n\ncache.kyouma.net:Frjwu4q1rnwE/MnSTmX9yx86GNA/z3p/oElGvucLiZg=' '';
|
2024-05-10 20:09:39 +02:00
|
|
|
extraConfig = ''
|
|
|
|
types { } default_type "text/plain; charset=utf-8";
|
|
|
|
'';
|
|
|
|
};
|
2024-05-09 20:21:49 +02:00
|
|
|
};
|
|
|
|
};
|
2024-05-11 16:02:39 +02:00
|
|
|
security.acme.certs."hydra.kyouma.net".extraDomainNames = [ "cache.kyouma.net" ];
|
2024-05-09 20:21:49 +02:00
|
|
|
}
|