Commit c9c2e3b9957f

Vincent Demeester <vincent@sbr.pm>
2020-12-16 16:23:16
systems: experiment with distributed builds
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent 94b02ac
Changed files (2)
systems/hosts/naruhodo.nix
@@ -59,9 +59,27 @@ in
     extraModprobeConfig = ''
       options v4l2loopback exclusive_caps=1
     '';
-    binfmt.emulatedSystems = [ "armv7l-linux" "aarch64-linux" ];
+    binfmt.emulatedSystems = [
+      "armv6l-linux"
+      "armv7l-linux"
+      "aarch64-linux"
+    ];
   };
 
+  nix.distributedBuilds = true;
+  nix.buildMachines = [{
+    hostName = "192.168.1.77";
+    maxJobs = 8;
+    sshUser = "builder";
+    sshKey = "/etc/nixos/secrets/builder";
+    systems = [ "x86_64-linux" "aarch64-linux" "armv7l-linux" "armv6l-linux" ];
+    supportedFeatures = [
+      "big-parallel"
+      "kvm"
+      "nixos-test"
+    ];
+  }];
+
   services.hardware.bolt.enable = true;
   profiles = {
     desktop.i3.enable = true;
systems/hosts/wakasu.nix
@@ -45,7 +45,18 @@ in
     };
   };
   */
-  boot.binfmt.emulatedSystems = [ "armv7l-linux" "aarch64-linux" ];
+  boot.binfmt.emulatedSystems = [
+    "armv6l-linux"
+    "armv7l-linux"
+    "aarch64-linux"
+  ];
+
+  users.extraUsers.builder = {
+    isNormalUser = true;
+    uid = 1018;
+    extraGroups = [ ];
+    openssh.authorizedKeys.keys = [ (builtins.readFile "/etc/nixos/secrets/builder.pub") ];
+  };
 
   fileSystems."/" = {
     device = "/dev/disk/by-uuid/6590b73d-72a4-4356-94b1-f56ac45c976d";