feat: distributed builds

This commit is contained in:
TheGeneralist 2025-07-01 17:30:24 +02:00
parent b2ee468733
commit c9baa840d9
Signed by: thegeneralist01
SSH key fingerprint: SHA256:pp9qddbCNmVNoSjevdvQvM5z0DHN7LTa8qBMbcMq/R4
5 changed files with 59 additions and 20 deletions

View file

@ -1,4 +1,9 @@
{ pkgs, lib, ...}: {
{ config, pkgs, lib, ...}: let
subs = [
"https://cache.thegeneralist01.com/"
"https://cache.nixos.org/"
];
in {
# todo: gc
environment.systemPackages = with pkgs; [
nh
@ -11,15 +16,28 @@
"pipe-operators"
];
extra-substituters = [
"https://cache.thegeneralist01.com/"
];
extra-substituters = subs;
trusted-substituters = subs;
extra-trusted-public-keys = [
"etc.thegeneralist01.com:BIhIf7HJ5xjFX+2e0WrGDQ4LdHeEEyQrtWBB1li2Ve8="
"cache.thegeneralist01.com:jkKcenR877r7fQuWq6cr0JKv2piqBWmYLAYsYsSJnT4="
];
trusted-users = [ "root" "@build" "@wheel" ];
builders-use-substitutes = true;
};
nix.distributedBuilds = true;
nix.buildMachines = if (config.networking.hostName != "thegeneralist-central") then [{
hostName = "thegeneralist-central";
maxJobs = 20;
protocol = "ssh-ng";
sshUser = "build";
supportedFeatures = [ "benchmark" "big-parallel" "kvm" "nixos-test" ];
system = "aarch64-linux";
}] else [];
home-manager.sharedModules = [{
programs.nh = {
enable = true;