Skip to content

Instantly share code, notes, and snippets.

@stepbrobd
Last active June 2, 2024 20:40
Show Gist options
  • Save stepbrobd/d0698d53438cad881ec767e8f3dc3e67 to your computer and use it in GitHub Desktop.
Save stepbrobd/d0698d53438cad881ec767e8f3dc3e67 to your computer and use it in GitHub Desktop.
distributed build with nixbuild.net for nix-darwin
let
nixbuildDomain = "eu.nixbuild.net";
nixbuildKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPIQCZc54poJ8vqawd8TraNryQeJnvH1eLpIDgbiqymM";
nixbuildPlatforms = [ "x86_64-linux" "aarch64-linux" ];
nixbuildFeatures = [ "big-parallel" "benchmark" "kvm" "nixos-test" ];
nixbuildSSH = ''
Host eu.nixbuild.net
PubkeyAcceptedKeyTypes ssh-ed25519
ServerAliveInterval 60
IPQoS throughput
IdentityFile /etc/ssh/ssh_host_ed25519_key
'';
in
{
nix = {
distributedBuilds = true;
buildMachines = forEach cfg.systems (system: {
inherit system;
hostName = nixbuildDomain;
maxJobs = 100;
supportedFeatures = nixbuildFeatures;
});
settings.extra-substituters = [ "ssh://eu.nixbuild.net" ];
settings.trusted-public-keys = [ "nixbuild.net/CQ9XPX-1:8WFF5qINzG2FrrvIePqdH+XraKME30g3+Es3aCWBw24=" ];
};
programs.ssh.knownHosts.nixbuild = {
hostNames = [ nixbuildDomain ];
publicKey = nixbuildKey;
};
environment.etc."ssh/ssh_config.d/nixbuild".text = nixbuildSSH;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment