VEGAS: provide a Nix binary cache

This commit is contained in:
Max Headroom 2021-10-16 20:24:13 +02:00
parent cf267ccbf8
commit 7635bf6ff4
2 changed files with 19 additions and 0 deletions

View file

@ -0,0 +1,18 @@
{ config, tools, ... }:
with tools.nginx;
let
addrSplit' = builtins.split ":" config.services.minio.listenAddress;
addrSplit = builtins.filter builtins.isString addrSplit';
host' = builtins.head addrSplit;
host = if host' == "" then "127.0.0.1" else host';
port = builtins.head (builtins.tail addrSplit);
in
{
services.nginx.virtualHosts."cache.${tools.meta.domain}" = vhosts.basic // {
locations = {
"= /".return = "302 /404";
"/".proxyPass = "http://${host}:${port}/nix-store$request_uri";
"/nix/store".proxyPass = "http://127.0.0.1:${builtins.toString config.services.nar-serve.port}";
};
};
}

View file

@ -29,6 +29,7 @@
./services/nfs
./services/mail
./services/matrix
./services/nix/binary-cache.nix
./services/object-storage
./services/warehouse
./services/websites