VEGAS: provide a Nix binary cache
This commit is contained in:
parent
cf267ccbf8
commit
7635bf6ff4
2 changed files with 19 additions and 0 deletions
18
hosts/VEGAS/services/nix/binary-cache.nix
Normal file
18
hosts/VEGAS/services/nix/binary-cache.nix
Normal 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}";
|
||||
};
|
||||
};
|
||||
}
|
|
@ -29,6 +29,7 @@
|
|||
./services/nfs
|
||||
./services/mail
|
||||
./services/matrix
|
||||
./services/nix/binary-cache.nix
|
||||
./services/object-storage
|
||||
./services/warehouse
|
||||
./services/websites
|
||||
|
|
Loading…
Reference in a new issue