binary cache

This commit is contained in:
Grimmauld 2024-05-09 22:32:39 +02:00
parent f969379666
commit efee6588cd
3 changed files with 24 additions and 0 deletions

View File

@ -119,11 +119,13 @@ in
nix.settings.extra-substituters = [
"https://cache.lix.systems"
"https://nyx.chaotic.cx/"
"https://nixcache.grimmauld.de"
];
nix.settings.trusted-public-keys = [
"cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o="
"nyx.chaotic.cx-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8="
"chaotic-nyx.cachix.org-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8="
"nixcache.grimmauld.de:LFBlakr8RYIuVb9I1S0+L9JGyB2THcfbPa0W6srghqo="
];
}

View File

@ -22,6 +22,7 @@ in
./email.nix
./discord-matrix-bridge.nix
./mastodon.nix
./nix_cache.nix
];
options.serverConfig = with lib; {
@ -179,6 +180,10 @@ in
host = "mastodon.${domain}";
accessType = "none";
};
nix_cache_host = {
host = "nixcache.${domain}";
port = 5000;
};
};
};

17
modules/nix_cache.nix Normal file
View File

@ -0,0 +1,17 @@
{
lib,
config,
inputs,
pkgs,
...
}:
let
inherit (config.serverConfig) ports vhosts;
in
{
services.nix-serve = {
enable = true;
secretKeyFile = "/var/cache-priv-key.pem";
port = vhosts.nix_cache_host.port;
};
}