about summary refs log tree commit diff
path: root/nix/hosts/corrino/www/hydra.emile.space.nix
blob: e89888bb4c4216120b9ae6b6268fb2d57b3be0b9 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
{ config, pkgs, ... }:

{
  services.nginx.virtualHosts."hydra.emile.space" = {
    forceSSL = true;
    enableACME = true;

    locations = {
      "/" = {
        proxyPass = "http://127.0.0.1:${toString config.services.hydra.port}";
      };
    };
  };

  # make hydra send emails
  services.postfix = {
    enable = true;
    setSendmail = true;
  };

  services.hydra = {
    enable = true;

    package = pkgs.hydra_unstable.overrideAttrs (old: {
      patches = (if old ? patches then old.patches else [ ]) ++ [ ./hydra.patch ];
    });

    listenHost = "*";
    port = config.emile.ports.hydra;
    hydraURL = "https://hydra.emile.space"; # externally visible URL

    # Directory that holds Hydra garbage collector roots.
    gcRootsDir = "/nix/var/nix/gcroots/hydra";

    # a standalone hydra will require you to unset the buildMachinesFiles list to avoid using a nonexistant /etc/nix/hosts
    buildMachinesFiles = [ ];
    # you will probably also want, otherwise *everything* will be built from scratch
    useSubstitutes = true;

    # notification settings
    smtpHost = "mail.emile.space";
    notificationSender = "hydra@emile.space";

    # Threshold of minimum disk space (GiB) to determine if the evaluator should run or not.
    minimumDiskFreeEvaluator = 20;

    # Threshold of minimum disk space (GiB) to determine if the queue runner should run or not.
    minimumDiskFree = 20;

    # Path to a file containing the logo of your Hydra instance
    # logo = ;

    extraConfig = ''
      <git-input>
        timeout = 3600
      </git-input>
      binary_cache_public_uri = https://nix-cache.emile.space
    '';
    # evaluator_restrict_eval = false
  };
}