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

36 lines
953 B
Nix
Raw Normal View History

2020-07-19 17:20:21 +00:00
# SPDX-FileCopyrightText: 2020 Luke Granger-Brown <depot@lukegb.com>
#
# SPDX-License-Identifier: Apache-2.0
2023-03-12 03:51:10 +00:00
{ lib, config, ... }:
2020-07-19 17:20:21 +00:00
{
2023-03-12 03:51:10 +00:00
imports = [ ./nixbuild-key.nix ];
2020-07-19 17:20:21 +00:00
# Distributed builds!
nix.buildMachines = lib.mkAfter [ {
2023-03-12 03:51:10 +00:00
hostName = "whitby-build";
2020-07-19 17:20:21 +00:00
system = "x86_64-linux";
maxJobs = 64;
speedFactor = 4;
2020-07-19 17:20:21 +00:00
supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ];
mandatoryFeatures = [ ];
}];
nix.distributedBuilds = true;
nix.extraOptions = ''
builders-use-substitutes = true
'';
2023-03-12 03:51:10 +00:00
programs.ssh.extraConfig = ''
Host whitby-build
User lukegb
PubkeyAcceptedKeyTypes ssh-ed25519
IdentityFile ${config.my.vault.secrets.id_ed25519_nixbuild.path}
'';
programs.ssh.knownHosts = {
whitby-build = {
hostNames = [ "whitby.tvl.fyi" "whitby-build" ];
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILNh/w4BSKov0jdz3gKBc98tpoLta5bb87fQXWBhAl2I";
};
};
2020-07-19 17:20:21 +00:00
}