From f62cec24012479c48409da2003ca8c4a23a80e35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Mon, 18 Apr 2022 17:07:37 +0200 Subject: [PATCH] :rocket: add distibuted builds --- hosts/nixos-laptop/default.nix | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/hosts/nixos-laptop/default.nix b/hosts/nixos-laptop/default.nix index 478410c..d08b116 100644 --- a/hosts/nixos-laptop/default.nix +++ b/hosts/nixos-laptop/default.nix @@ -104,6 +104,30 @@ wantedBy = [ "multi-user.target" ]; }; + nix = { + distributedBuilds = true; + buildMachines = [{ + hostName = "builder"; + system = "x86_64-linux"; + maxJobs = 6; + speedFactor = 2; + supportedFeatures = [ "nixos.test" "benchmark" "big-parallel" "kvm" ]; + }]; + extraOptions = '' + builders-use-substitutes = true + ''; + }; + + programs.ssh.extraConfig = '' + Host builder + Hostname 192.168.0.14 + Port 22 + User moritz + + IdentitiesOnly yes + IdentityFile /etc/ssh/ssh_host_ed25519_key + ''; + # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave