mirror of
https://github.com/JulienMalka/snowfield.git
synced 2025-03-26 05:40:52 +01:00
merge
This commit is contained in:
commit
13dac666f7
2 changed files with 52 additions and 19 deletions
|
@ -14,25 +14,11 @@ in
|
|||
luj = {
|
||||
filerun.enable = true;
|
||||
zfs-mails.enable = true;
|
||||
};
|
||||
|
||||
|
||||
services.hydra = {
|
||||
enable = true;
|
||||
hydraURL = "https://hydra.julienmalka.me";
|
||||
notificationSender = "hydra@localhost";
|
||||
port = 9876;
|
||||
buildMachinesFiles = [ ];
|
||||
useSubstitutes = true;
|
||||
};
|
||||
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
virtualHosts = {
|
||||
"hydra.julienmalka.me" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations."/" = { proxyPass = "http://127.0.0.1:9876"; };
|
||||
hydra = {
|
||||
enable = true;
|
||||
nginx = {
|
||||
enable = true;
|
||||
subdomain = "hydra";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
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