nix-serve should no longer use the default store. Move binaryCaches into the machine submodule.

This commit is contained in:
Kevin Baensch 2019-12-14 07:46:00 +01:00
parent 89debb2c37
commit 345c054448
3 changed files with 19 additions and 9 deletions

View file

@ -10,7 +10,9 @@
with lib;
mkIf (elem "hydra" config.machine.services) {
let
cacheDir = "/var/cache/hydra";
in mkIf (elem "hydra" config.machine.services) {
# also take a look at ../conf/nix.nix
nix.buildMachines = [
{
@ -40,7 +42,7 @@ mkIf (elem "hydra" config.machine.services) {
# hydra.conf: binary_cache_secret_key_file is deprecated and ignored. use store_uri=...?secret-key= instead
extraConfig = ''
max_output_size = 4294967296
store_uri = file:///var/cache/hydra?secret-key=${cfg.secretPath}/hydra_cache&write-nar-listing=1&ls-compression=br&log-compression=br
store_uri = file://${cacheDir}?secret-key=${cfg.secretPath}/hydra_cache&write-nar-listing=1&ls-compression=br&log-compression=br
# add ?local-nar-cache= to set nar cache location
server_store_uri = https://cache.${cfg.domain}
binary_cache_public_uri https://cache.${cfg.domain}
@ -59,5 +61,6 @@ mkIf (elem "hydra" config.machine.services) {
# --group hydra
'';
};
};
};
systemd.services.nix-serve.environment.NIX_STORE_DIR = cacheDir;
}