From a11991862728903dda795e42918f858b2ad8ac34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vili=20Sinerv=C3=A4?= Date: Wed, 11 Jun 2025 20:45:47 +0300 Subject: [PATCH] Update CI server configuration --- hosts/ci/configuration.nix | 3 +- servers/{ci.nix => forgejo-runner.nix} | 0 servers/forgejo.nix | 17 ++---------- servers/hydra.nix | 38 ++++++++++++++++++++++++++ 4 files changed, 42 insertions(+), 16 deletions(-) rename servers/{ci.nix => forgejo-runner.nix} (100%) create mode 100644 servers/hydra.nix diff --git a/hosts/ci/configuration.nix b/hosts/ci/configuration.nix index f24380b..e7fdc97 100644 --- a/hosts/ci/configuration.nix +++ b/hosts/ci/configuration.nix @@ -5,6 +5,7 @@ ../../shared/hardware/vm.nix ../../shared/disko/basic-ext4.nix - ../../servers/ci.nix + ../../servers/forgejo-runner.nix + ../../servers/hydra.nix ]; } diff --git a/servers/ci.nix b/servers/forgejo-runner.nix similarity index 100% rename from servers/ci.nix rename to servers/forgejo-runner.nix diff --git a/servers/forgejo.nix b/servers/forgejo.nix index 07c4ef6..efb5458 100644 --- a/servers/forgejo.nix +++ b/servers/forgejo.nix @@ -46,21 +46,8 @@ }; }; - nginx = { - enable = true; - recommendedGzipSettings = true; - recommendedOptimisation = true; - recommendedTlsSettings = true; - recommendedProxySettings = true; - - virtualHosts.${config.services.forgejo.settings.server.DOMAIN} = { - enableACME = true; - forceSSL = true; - kTLS = true; - locations."/" = { - proxyPass = "http://localhost:8000"; - }; - }; + nginx.virtualHosts.${config.services.forgejo.settings.server.DOMAIN}.locations."/" = { + proxyPass = "http://localhost:8000"; }; }; } diff --git a/servers/hydra.nix b/servers/hydra.nix new file mode 100644 index 0000000..f77ba7b --- /dev/null +++ b/servers/hydra.nix @@ -0,0 +1,38 @@ +{ config, ... }: +{ + imports = [ + ./utils/nginx-https-server.nix + ./utils/acme-http-client.nix + ]; + + services.hydra = { + enable = true; + hydraURL = "https://ci.sinerva.eu/"; + listenHost = "::1"; + notificationSender = "hydra@sinerva.eu"; + port = 8080; + useSubstitutes = true; + + extraConfig = ""; + extraEnv = ""; + }; + + nix.buildMachines = [ + { + hostName = "localhost"; + protocol = null; + system = "x86_64-linux"; + supportedFeatures = [ + "kvm" + "nixos-test" + "big-parallel" + "benchmark" + ]; + maxJobs = 6; + } + ]; + + nginx.virtualHosts.${config.services.hydra.hydraURL}.locations."/" = { + proxyPass = "http://localhost:8080"; + }; +}