[NixOS] Set up cache server

This commit is contained in:
2023-08-22 17:11:37 -06:00
parent 0fd0490714
commit 83658a0721
8 changed files with 32 additions and 2 deletions

20
nixos/cache-server.nix Normal file
View File

@@ -0,0 +1,20 @@
{ config, makeEnable, ... }:
makeEnable config "modules.cache-server" false {
age.secrets."cache-priv-key.pem".file = ./secrets/cache-priv-key.pem.age;
services.nix-serve = {
enable = true;
secretKeyFile = config.age.secrets."cache-priv-key.pem".path;
port = 5050;
};
services.nginx = {
enable = true;
recommendedProxySettings = true;
virtualHosts = {
"0.0.0.0" = {
locations."/".proxyPass = "http://${config.services.nix-serve.bindAddress}:${toString config.services.nix-serve.port}";
};
};
};
}