Setup binary cache on c3 and optimize nix settings.

This commit is contained in:
2025-10-23 21:59:08 +01:00
parent 58bb710cb9
commit 94f71cc62e
3 changed files with 80 additions and 4 deletions

View File

@@ -1,8 +1,30 @@
{
nix.settings.trusted-users = [
"root"
"@wheel"
];
nix.settings = {
trusted-users = [
"root"
"@wheel"
];
# Binary cache configuration
substituters = [
"http://c3:5000" # Local cluster cache on c3
"https://cache.nixos.org"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
# TODO: Add c3 cache public key here after first deploy of c3
# Get it with: ssh c3 cat /persist/nix-cache/cache-pub-key.txt
# "c3-cache:..."
];
# Performance tuning
max-jobs = "auto"; # Use all cores for parallel builds
cores = 0; # Each build can use all cores
max-substitution-jobs = 16; # Faster fetching from caches
http-connections = 25; # More parallel downloads
download-attempts = 3; # Retry failed downloads
};
nix.gc = {
automatic = true;
dates = "weekly";