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 = [ nix.settings.extra-substituters = [
"https://cache.lix.systems" "https://cache.lix.systems"
"https://nyx.chaotic.cx/" "https://nyx.chaotic.cx/"
"https://nixcache.grimmauld.de"
]; ];
nix.settings.trusted-public-keys = [ nix.settings.trusted-public-keys = [
"cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o=" "cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o="
"nyx.chaotic.cx-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8=" "nyx.chaotic.cx-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8="
"chaotic-nyx.cachix.org-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 ./email.nix
./discord-matrix-bridge.nix ./discord-matrix-bridge.nix
./mastodon.nix ./mastodon.nix
./nix_cache.nix
]; ];
options.serverConfig = with lib; { options.serverConfig = with lib; {
@ -179,6 +180,10 @@ in
host = "mastodon.${domain}"; host = "mastodon.${domain}";
accessType = "none"; 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;
};
}