clan-infra/modules/web01/harmonia.nix
Jörg Thalheim 638ad6d498
All checks were successful
build / test (pull_request) Successful in 6s
switch to clan-core secrets
2023-08-23 15:06:46 +02:00

29 lines
867 B
Nix

{ config, pkgs, ... }: {
services.harmonia.enable = true;
# $ nix-store --generate-binary-cache-key cache.yourdomain.tld-1 harmonia.secret harmonia.pub
services.harmonia.signKeyPath = config.sops.secrets.harmonia-key.path;
services.nginx = {
package = pkgs.nginxStable.override {
modules = [ pkgs.nginxModules.zstd ];
};
};
services.nginx.virtualHosts."cache.clan.lol" = {
forceSSL = true;
enableACME = true;
locations."/".extraConfig = ''
proxy_pass http://127.0.0.1:5000;
proxy_set_header Host $host;
proxy_redirect http:// https://;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
zstd on;
zstd_types application/x-nix-archive;
'';
};
}