2024-10-18 23:59:23 -04:00
|
|
|
{
|
|
|
|
|
lib,
|
|
|
|
|
config,
|
|
|
|
|
pkgs,
|
|
|
|
|
...
|
|
|
|
|
}:
|
|
|
|
|
with lib;
|
|
|
|
|
with lib.custom; let
|
|
|
|
|
cfg = config.sites.hydra;
|
2024-10-19 02:11:34 -04:00
|
|
|
|
|
|
|
|
sec = config.age.secrets;
|
2024-10-18 23:59:23 -04:00
|
|
|
in {
|
|
|
|
|
options.sites.hydra = with types; {
|
|
|
|
|
enable = mkBoolOpt false "Enable Hydra";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
|
services.hydra = {
|
|
|
|
|
enable = true;
|
|
|
|
|
hydraURL = "https://hydra.zoeys.computer";
|
|
|
|
|
useSubstitutes = true;
|
|
|
|
|
notificationSender = "hydra@localhost"; # e-mail of hydra service
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
services.nginx.virtualHosts."hydra.zoeys.computer" = {
|
|
|
|
|
forceSSL = true;
|
|
|
|
|
enableACME = true;
|
|
|
|
|
locations."/" = {
|
|
|
|
|
proxyPass = "http://localhost:3000";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2024-10-19 02:11:34 -04:00
|
|
|
users.users.hydra.extraGroups = ["keys"];
|
2024-10-18 23:59:23 -04:00
|
|
|
|
2024-10-19 02:11:34 -04:00
|
|
|
nix = {
|
|
|
|
|
settings.allowed-uris = [
|
|
|
|
|
"github:"
|
|
|
|
|
"https://github.com"
|
|
|
|
|
"git+https://github.com/"
|
|
|
|
|
"git+ssh://github.com/"
|
|
|
|
|
"git+https://git.zoeys.computer/"
|
|
|
|
|
"git+ssh://git.zoeys.computer/"
|
2024-11-13 20:35:13 -05:00
|
|
|
"path:"
|
2024-10-19 02:11:34 -04:00
|
|
|
];
|
|
|
|
|
trustedUsers = ["hydra"]; # Ensure hydra user is trusted for nix
|
|
|
|
|
buildMachines = [
|
|
|
|
|
{
|
|
|
|
|
hostName = "localhost";
|
|
|
|
|
protocol = null;
|
|
|
|
|
system = "x86_64-linux";
|
|
|
|
|
supportedFeatures = ["kvm" "nixos-test" "big-parallel" "benchmark"];
|
|
|
|
|
maxJobs = 8;
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
};
|
2024-10-18 23:59:23 -04:00
|
|
|
};
|
|
|
|
|
}
|