add binary-cache and nginx

This commit is contained in:
Patrick Neff 2024-04-14 17:26:59 +02:00
parent 3b2663f64d
commit defb1afda8
3 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,24 @@
{
lib,
config,
...
}: let
cfg = config.services.nix-serve;
in
with lib; {
config = mkIf cfg.enable {
services = {
nix-serve = {
secretKeyFile = "/var/cache-priv-key.pem";
};
nginx = {
virtualHosts = {
# ... existing hosts config etc. ...
"binarycache.odie.intranet" = {
locations."/".proxyPass = "http://${config.services.nix-serve.bindAddress}:${toString config.services.nix-serve.port}";
};
};
};
};
};
}

View File

@ -0,0 +1,6 @@
{
imports = [
./nginx
./binary-cache
];
}

View File

@ -0,0 +1,5 @@
{config,lib}: with lib; mkIf config.services.nginx.enable {
services.nginx = {
recommendedProxySettings = true;
};
}