diff --git a/modules/nixos/system.nix b/modules/nixos/system.nix index 94a24d2..dedae10 100644 --- a/modules/nixos/system.nix +++ b/modules/nixos/system.nix @@ -182,4 +182,44 @@ in maxretry = 5; bantime = "1h"; }; + + nix = { + distributedBuilds = true; + + buildMachines = [ + { + hostName = "linux-builder"; + protocol = "ssh-ng"; + sshUser = "builder"; + sshKey = "/etc/nix/builder_ed25519"; + publicHostKey = "c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUpCV2N4Yi9CbGFxdDFhdU90RStGOFFVV3JVb3RpQzVxQkorVXVFV2RWQ2Igcm9vdEBuaXhvcwo="; + systems = [ + "aarch64-linux" + "x86_64-linux" + ]; + maxJobs = 1; + supportedFeatures = [ + "kvm" + "benchmark" + "big-parallel" + ]; + } + ]; + + settings.builders-use-substitutes = true; + }; + + programs.ssh = { + extraConfig = '' + Host linux-builder + User builder + HostName ramen.char-ruler.ts.net + HostKeyAlias linux-builder + Port 31023 + IdentityFile /etc/nix/builder_ed25519 + IdentitiesOnly yes + ''; + + knownHosts.linux-builder.publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJBWcxb/Blaqt1auOtE+F8QUWrUotiC5qBJ+UuEWdVCb"; + }; }