depot/ops/nixos/lib/nixbuild-distributed.nix

42 lines
1.1 KiB
Nix
Raw Normal View History

2023-03-09 21:33:42 +00:00
# SPDX-FileCopyrightText: 2023 Luke Granger-Brown <depot@lukegb.com>
#
# SPDX-License-Identifier: Apache-2.0
{ config, lib, ... }:
{
2023-03-12 03:51:10 +00:00
imports = [ ./nixbuild-key.nix ];
2023-03-09 21:33:42 +00:00
# Distributed builds!
nix.buildMachines = lib.mkAfter [{
hostName = "eu.nixbuild.net";
system = "aarch64-linux";
maxJobs = 100;
speedFactor = 1;
supportedFeatures = [ "benchmark" "big-parallel" ];
mandatoryFeatures = [ ];
} {
hostName = "eu.nixbuild.net";
system = "x86_64-linux";
maxJobs = 100;
speedFactor = 1;
supportedFeatures = [ "benchmark" "big-parallel" ];
mandatoryFeatures = [ ];
}];
nix.distributedBuilds = true;
nix.extraOptions = ''
builders-use-substitutes = true
'';
programs.ssh.extraConfig = ''
Host eu.nixbuild.net
PubkeyAcceptedKeyTypes ssh-ed25519
IdentityFile ${config.my.vault.secrets.id_ed25519_nixbuild.path}
'';
programs.ssh.knownHosts = {
nixbuild = {
hostNames = [ "eu.nixbuild.net" ];
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPIQCZc54poJ8vqawd8TraNryQeJnvH1eLpIDgbiqymM";
};
};
}