about summary refs log tree commit diff
path: root/modules/services/hydra.nix
blob: 65f602c10716dd9a7f1e612c9dfcfcf48005dda7 (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
{ config, lib, pkgs, hydra, ... }:

with lib;
let
  cfg = config.modules.services.hydra;
in
{
  options.modules.services.hydra = {
    enable = mkEnableOption "Whether to enable Hydra, a Nix-based continuous build system";
    baseURL = mkOption {
      type = types.str;
      example = "https://hydra.kusanari.network";
      description = "The base URL for the Hydra webserver instance";
    };
  };

  config = mkIf cfg.enable {
    services.hydra = {
      enable = true;

      package = hydra.packages.x86_64-linux.hydra;

      hydraURL = cfg.baseURL;
      dbi = "dbi:Pg:dbname=hydra;user=hydra;";
      useSubstitutes = true;
      notificationSender = "hydra@kusanari.network";

      listenHost = "localhost";
      port = 4004;
    };

    modules.persistence.directories = [
      "/var/lib/hydra"
    ];

    nix.settings.allowed-uris = [ "github:" "https://" "http://" ];
  };
}