nixos-config/modules/services/dmz/hydra.nix

68 lines
1.7 KiB
Nix
Raw Normal View History

2024-05-05 19:39:35 +02:00
{ lib, config, pkgs, ... }:
{
services = {
hydra = {
enable = true;
hydraURL = "https://hydra.home.opel-online.de";
listenHost = "localhost";
notificationSender = "hydra@localhost";
useSubstitutes = true;
minimumDiskFree = 30;
};
nix-serve = {
enable = true;
port = 5001;
bindAddress = "127.0.0.1";
secretKeyFile = config.age.secrets."keys/nixsign".path;
};
nginx = {
enable = true;
virtualHosts = {
"hydra.home.opel-online.de" = {
enableACME = true;
forceSSL = true;
locations."/".proxyPass = "http://localhost:3000";
};
"cache.home.opel-online.de" = {
enableACME = true;
forceSSL = true;
locations."/".proxyPass = "http://localhost:5001";
};
};
};
};
security.acme = {
acceptTerms = true;
defaults = {
email = "webmaster@kabtop.de";
#defaults.server = "https://acme-staging-v02.api.letsencrypt.org/directory";
dnsProvider = "netcup";
environmentFile = config.age.secrets."services/acme/opel-online".path;
webroot = null;
};
};
nix = {
settings.trusted-users = [
"hydra"
];
extraOptions = ''
secret-key-files = ${config.age.secrets."keys/nixsign".path}
'';
};
age.secrets."keys/nixsign" = {
file = ../../../secrets/keys/nixservepriv.age;
owner = "hydra";
};
age.secrets."services/acme/opel-online" = {
file = ../../../secrets/services/acme/opel-online.age;
owner = "acme";
};
2024-05-05 19:39:35 +02:00
}