mirror of
https://github.com/JulienMalka/snowfield.git
synced 2025-04-01 01:30:53 +02:00
Created Hydra module
This commit is contained in:
parent
59d599b65f
commit
835a05dd64
2 changed files with 52 additions and 19 deletions
|
@ -14,25 +14,11 @@ in
|
||||||
luj = {
|
luj = {
|
||||||
filerun.enable = true;
|
filerun.enable = true;
|
||||||
zfs-mails.enable = true;
|
zfs-mails.enable = true;
|
||||||
};
|
hydra = {
|
||||||
|
|
||||||
|
|
||||||
services.hydra = {
|
|
||||||
enable = true;
|
enable = true;
|
||||||
hydraURL = "https://hydra.julienmalka.me";
|
nginx = {
|
||||||
notificationSender = "hydra@localhost";
|
|
||||||
port = 9876;
|
|
||||||
buildMachinesFiles = [ ];
|
|
||||||
useSubstitutes = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
services.nginx = {
|
|
||||||
enable = true;
|
enable = true;
|
||||||
virtualHosts = {
|
subdomain = "hydra";
|
||||||
"hydra.julienmalka.me" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
locations."/" = { proxyPass = "http://127.0.0.1:9876"; };
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
47
modules/hydra/default.nix
Normal file
47
modules/hydra/default.nix
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
{ lib, pkgs, config, ... }:
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.luj.hydra;
|
||||||
|
port = 9876;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
|
||||||
|
options.luj.hydra = {
|
||||||
|
enable = mkEnableOption "activate hydra service";
|
||||||
|
nginx.enable = mkEnableOption "activate nginx";
|
||||||
|
nginx.subdomain = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable (
|
||||||
|
mkMerge [{
|
||||||
|
|
||||||
|
services.hydra = {
|
||||||
|
enable = true;
|
||||||
|
notificationSender = "hydra@localhost";
|
||||||
|
port = port;
|
||||||
|
buildMachinesFiles = [ ];
|
||||||
|
useSubstitutes = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.firewall = { allowedTCPPorts = [ port ]; };
|
||||||
|
}
|
||||||
|
|
||||||
|
(mkIf cfg.nginx.enable {
|
||||||
|
luj.nginx.enable = true;
|
||||||
|
services.hydra.hydraURL = "${cfg.nginx.subdomain}.julienmalka.me";
|
||||||
|
services.nginx.virtualHosts."${cfg.nginx.subdomain}.julienmalka.me" = {
|
||||||
|
enableACME = true;
|
||||||
|
forceSSL = true;
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://localhost:${toString port}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
})]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue