From 445e6b5a2219d081e480f45cd07cb2fad4e47ab3 Mon Sep 17 00:00:00 2001 From: beatzaplenty Date: Wed, 16 Jul 2025 18:25:55 +1000 Subject: [PATCH] configure nix-cache modified: hosts/nix-cache/configuration.nix --- hosts/nix-cache/configuration.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hosts/nix-cache/configuration.nix b/hosts/nix-cache/configuration.nix index 97ac96d..b7a5c89 100644 --- a/hosts/nix-cache/configuration.nix +++ b/hosts/nix-cache/configuration.nix @@ -11,9 +11,19 @@ ]; networking.hostName = "nix-cache"; # Define your hostname. - virtualisation.docker.enable = true; + services.nix-serve.enable = true; + services.nix-serve.secretKeyFile = "/etc/nix/cache-priv.pem"; + services.nginx = { + enable = true; + recommendedProxySettings = true; + virtualHosts."cache.local" = { + locations."/".proxyPass = "http://${config.services.nix-serve.bindAddress}:${toString config.services.nix-serve.port}"; + }; + }; + + networking.firewall.allowedTCPPorts = [ config.services.nginx.defaultHTTPListenPort ]; # Open ports in the firewall. # networking.firewall.allowedTCPPorts = [ 80 8080 443 ]; # networking.firewall.allowedUDPPorts = [ ... ];