loptland: modularize config a little by pulling out modules for gitea-runner and hydra
This commit is contained in:
parent
71e8eab3dc
commit
6b31252058
3 changed files with 230 additions and 54 deletions
37
modules/nixos/services/hydra/default.nix
Normal file
37
modules/nixos/services/hydra/default.nix
Normal file
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
namespace,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.${namespace}.services.hydra;
|
||||
inherit (lib) mkIf mkOption mkEnableOption;
|
||||
in
|
||||
{
|
||||
options.${namespace}.services.hydra = {
|
||||
enable = mkEnableOption "Enable Hydra CI";
|
||||
httpPort = mkOption {
|
||||
type = lib.types.int;
|
||||
default = 2000;
|
||||
description = "The path to host the http server on, relevant for nginx forwarding";
|
||||
};
|
||||
|
||||
enableCache = mkEnableOption "Enable cache using nix-server";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.nix-serve = mkIf cfg.enableCache {
|
||||
enable = true;
|
||||
secretKeyFile = "/var/cache-priv-key.pem";
|
||||
};
|
||||
|
||||
services.hydra = {
|
||||
enable = true;
|
||||
hydraURL = "http://localhost:${toString cfg.httpPort}";
|
||||
port = cfg.httpPort;
|
||||
notificationSender = "hydra@localhost";
|
||||
useSubstitutes = true;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue