From 2aabbdf5cfd2ba1a59810dd2d35b77f794b164f7 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 8 Jan 2025 20:00:36 +0000 Subject: [PATCH] fix distributed setup local --- .../distributed_builds/local-machine.nix | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/hosts/common/optional/distributed_builds/local-machine.nix b/hosts/common/optional/distributed_builds/local-machine.nix index bb8d775..9e2f23e 100644 --- a/hosts/common/optional/distributed_builds/local-machine.nix +++ b/hosts/common/optional/distributed_builds/local-machine.nix @@ -1,8 +1,10 @@ -{ pkgs, configVars, ... }: -let - remoteMachineIp = configVars.networking.addresses.remote-builder.ip; -in { + pkgs, + configVars, + ... +}: let + remoteMachineIp = configVars.networking.addresses.remote-builder.ip; +in { nix.distributedBuilds = true; nix.settings.builders-use-substitutes = true; nix.settings.max-jobs = 0; @@ -11,23 +13,21 @@ in nix.buildMachines = [ { - hostName = remoteMachineIp; - sshUser = "remotebuild"; + hostName = "remotebuild@${remoteMachineIp}"; speedFactor = 1; maxJobs = 10; sshKey = "/root/.ssh/remotebuild"; system = pkgs.stdenv.hostPlatform.system; - supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ]; + supportedFeatures = ["nixos-test" "benchmark" "big-parallel" "kvm"]; } ]; - - # TODO: set known host here when have static ip on main server - # programs.ssh.knownHosts = { - # "merlin" = { - # publicKey = "server pubkey"; - # }; - # }; - + programs.ssh.extraConfig = '' + Host ${remoteMachineIp} + Port 22 + User remotebuild + IdentitiesOnly yes + IdentityFile /root/.ssh/remotebuild + ''; sops.secrets = { "ssh_keys/root/remotebuild" = { path = "/root/.ssh/remotebuild";