nixos-config/modules/offloading/offload.nix

32 lines
728 B
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
let
network = import ../../network.nix;
cfg = config.ptw.system.offloading.offload;
in {
options.ptw.system.offloading.offload = {
enable = lib.mkEnableOption "Allow offloading building of derivations";
};
config = lib.mkIf cfg.enable {
nix = {
distributedBuilds = true;
buildMachines = [{
hostName = "miku";
systems = [ "x86_64-linux" "i686-linux" ];
maxJobs = 4;
speedFactor = 2;
supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ];
}];
};
programs.ssh.extraConfig = ''
Host miku
HostName ${network.miku}
User builder
IdentitiesOnly yes
IdentityFile /root/.ssh/id_builder
'';
};
}