From 1c7fcddb45ca5bd474bfc438986617c1d2696c67 Mon Sep 17 00:00:00 2001 From: Linnnus Date: Thu, 27 Mar 2025 19:29:17 +0000 Subject: ali: Add ahmed as remote builder --- hosts/ali/remote-builders/ahmed-builder.nix | 36 +++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 hosts/ali/remote-builders/ahmed-builder.nix (limited to 'hosts/ali/remote-builders/ahmed-builder.nix') diff --git a/hosts/ali/remote-builders/ahmed-builder.nix b/hosts/ali/remote-builders/ahmed-builder.nix new file mode 100644 index 0000000..0da0fc5 --- /dev/null +++ b/hosts/ali/remote-builders/ahmed-builder.nix @@ -0,0 +1,36 @@ +# This module adds ahmed as a remote builder for ali. +# Note that ahmed is configured such that root@ali is allowed to connect to remotebuilder@ahmed. +# TODO: Dedublicate with hosts/muhammed/remote-builders/ahmed-builder.nix + +{metadata, ...}: { + nix.buildMachines = [ + { + protocol = "ssh-ng"; + hostName = "ahmed-builder"; + + system = "x86_64-linux"; + maxJobs = 1; + speedFactor = 1; + supportedFeatures = ["nixos-test" "benchmark" "big-parallel" "kvm"]; + mandatoryFeatures = []; + } + ]; + + environment.etc."ssh/ssh_config.d/100-ahmed-builder.conf".text = '' + Host ahmed-builder + User remotebuilder + Hostname ${metadata.hosts.ahmed.ipv4Address} + HostKeyAlias ahmed-builder + # This matches `users.users..authorizedKeys` on the server-side. + # HACK: We should use a purpose-specific key. + IdentityFile /Users/linus/.ssh/id_rsa + ''; + + # We have to trust ahmeds host key or the Nix daemon will fail to connect. + programs.ssh.knownHosts = { + ahmed-builder = { + hostNames = ["ahmed-builder"]; + publicKey = metadata.hosts.ahmed.sshKeys.root; + }; + }; +} -- cgit v1.2.3