nixos: abstract out distributed builds
This commit is contained in:
parent
6b2df5840e
commit
24ba5c1c36
3 changed files with 22 additions and 15 deletions
20
ops/nixos/lib/whitby-distributed.nix
Normal file
20
ops/nixos/lib/whitby-distributed.nix
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
# SPDX-FileCopyrightText: 2020 Luke Granger-Brown <depot@lukegb.com>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
{ pkgs, depot, lib, ... }:
|
||||||
|
{
|
||||||
|
# Distributed builds!
|
||||||
|
nix.buildMachines = [ {
|
||||||
|
hostName = "whitby";
|
||||||
|
system = "x86_64-linux";
|
||||||
|
maxJobs = 64;
|
||||||
|
speedFactor = 2;
|
||||||
|
supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ];
|
||||||
|
mandatoryFeatures = [ ];
|
||||||
|
}];
|
||||||
|
nix.distributedBuilds = true;
|
||||||
|
nix.extraOptions = ''
|
||||||
|
builders-use-substitutes = true
|
||||||
|
'';
|
||||||
|
}
|
|
@ -19,6 +19,7 @@ in {
|
||||||
imports = [
|
imports = [
|
||||||
../lib/zfs.nix
|
../lib/zfs.nix
|
||||||
../lib/client.nix
|
../lib/client.nix
|
||||||
|
../lib/whitby-distributed.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [
|
boot.initrd.availableKernelModules = [
|
||||||
|
|
|
@ -7,7 +7,7 @@ let
|
||||||
inherit (depot.ops) secrets;
|
inherit (depot.ops) secrets;
|
||||||
in {
|
in {
|
||||||
imports =
|
imports =
|
||||||
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix> ../lib/client.nix ];
|
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix> ../lib/client.nix ../lib/whitby-distributed.nix ];
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
|
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
|
||||||
boot.kernelModules = lib.mkAfter [ "kvm-intel" ];
|
boot.kernelModules = lib.mkAfter [ "kvm-intel" ];
|
||||||
|
@ -73,19 +73,5 @@ in {
|
||||||
networking.firewall.allowedTCPPorts = [ 111 2049 ];
|
networking.firewall.allowedTCPPorts = [ 111 2049 ];
|
||||||
networking.firewall.allowedUDPPorts = [ 111 2049 ];
|
networking.firewall.allowedUDPPorts = [ 111 2049 ];
|
||||||
|
|
||||||
# Distributed builds!
|
|
||||||
nix.buildMachines = [ {
|
|
||||||
hostName = "whitby";
|
|
||||||
system = "x86_64-linux";
|
|
||||||
maxJobs = 64;
|
|
||||||
speedFactor = 2;
|
|
||||||
supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ];
|
|
||||||
mandatoryFeatures = [ ];
|
|
||||||
}] ;
|
|
||||||
nix.distributedBuilds = true;
|
|
||||||
nix.extraOptions = ''
|
|
||||||
builders-use-substitutes = true
|
|
||||||
'';
|
|
||||||
|
|
||||||
system.stateVersion = "20.03";
|
system.stateVersion = "20.03";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue