nix-config/hosts/containers/hydra/hydra.nix

73 lines
1.9 KiB
Nix
Raw Normal View History

{ hostRegistry, config, pkgs, ... }:
2021-03-12 21:45:12 +01:00
2021-11-10 00:30:57 +01:00
let
2022-01-16 13:26:37 +01:00
nix-build = "client@${config.c3d2.hosts.nix-build.ip4}";
2021-11-10 00:30:57 +01:00
in {
2021-03-12 21:45:12 +01:00
nix = {
extraOptions = ''
allowed-uris = http:// https:// ssh://
2021-03-12 21:45:12 +01:00
'';
trustedUsers = [ "hydra" "root" ];
2021-11-10 00:30:57 +01:00
buildMachines = [ {
hostName = "localhost";
system = "x86_64-linux";
2022-04-16 02:57:25 +02:00
supportedFeatures = [ "big-parallel" "benchmark" ];
maxJobs = 4;
2021-11-10 00:30:57 +01:00
} {
hostName = nix-build;
system = "x86_64-linux";
supportedFeatures = [ "kvm" "nixos-test" "big-parallel" "benchmark" ];
2021-11-10 00:30:57 +01:00
maxJobs = 4;
} {
hostName = nix-build;
system = "aarch64-linux";
supportedFeatures = [ "nixos-test" "big-parallel" "benchmark" ];
maxJobs = 4;
} ];
daemonCPUSchedPolicy = "idle";
daemonIOSchedClass = "idle";
daemonIOSchedPriority = 7;
2021-03-12 21:45:12 +01:00
};
services.hydra = {
enable = true;
hydraURL = "https://hydra.hq.c3d2.de";
logo = ./c3d2.svg;
notificationSender = "hydra@spam.works";
2022-01-10 03:36:31 +01:00
package = pkgs.hydra-unstable.overrideAttrs (oa: {
# HACK for Hydra error: cannot write modified lock file of flake
patchPhase = ''
${pkgs.lib.optionalString (oa ? patchPhase) oa.patchPhase}
substituteInPlace src/script/hydra-eval-jobset \
--replace '"nix", "flake", "info"' '"nix", "flake", "info", "--no-write-lock-file"'
'';
});
useSubstitutes = true;
extraConfig = ''
max_output_size = 4294967296
'';
2021-03-12 21:45:12 +01:00
};
services.nginx =
let
hydraVhost = {
forceSSL = true;
enableACME = true;
locations."/".proxyPass =
"http://localhost:${toString config.services.hydra.port}";
};
in {
enable = true;
recommendedProxySettings = true;
recommendedGzipSettings = true;
virtualHosts = {
"hydra.hq.c3d2.de" = hydraVhost // {
default = true;
};
"hydra.serv.zentralwerk.org" = hydraVhost;
};
};
}