summaryrefslogtreecommitdiffstats
path: root/usecases/server/hydra-server.nix
blob: 6fbbdee5b4e4f5abe32e6efb5697d812f64a8cf1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
inputs:

{ config, lib, pkgs, ... }:

{
  options = with lib; {
    services.hydra.secretKeyLocation = mkOption {
      type = types.str;
      description = ''
        Absolute location to the secret key used to sign builds
      '';
    };
  };

  config = {
    services.hydra = {
      enable = true;
      #hydraURL = "https://hydra.huh.gdn";
      #notificationSender = "hydra@huh.gdn";
      buildMachinesFiles = [ ];
      # Don't build *everything* from source
      useSubstitutes = true;
      extraConfig = ''
        binary_cache_secret_key_file = ${config.services.hydra.secretKeyLocation}
        store_uri = auto?secret-key=${config.services.hydra.secretKeyLocation}
      '';
      package = pkgs.hydra-unstable;
    };

    nix.allowedUsers = [ "@hydra" ];

    networking.firewall.interfaces.${config.topology.mainVpn.interfaceName}.allowedTCPPorts = [
      config.services.hydra.port
    ];
  };
}