diff --git a/hosts/common/optional/distributed_builds/remote-builder-machine.nix b/hosts/common/optional/distributed_builds/remote-builder-machine.nix index 5174962..74a33cf 100644 --- a/hosts/common/optional/distributed_builds/remote-builder-machine.nix +++ b/hosts/common/optional/distributed_builds/remote-builder-machine.nix @@ -1,24 +1,15 @@ -{ pkgs, configVars, ... }: -let - remoteBuilderIp = configVars.networking.addresses.remote-builder.ip; -in { - nix.distributedBuilds = true; - nix.settings.builders-use-substitutes = true; + users.users.remotebuild = { + isNormalUser = true; + createHome = false; + group = "remotebuild"; - nix.buildMachines = [ - { - hostName = remoteBuilderIp; - sshUser = "remotebuild"; - sshKey = "/root/.ssh/remotebuild"; - system = pkgs.stdenv.hostPlatform.system; - supportedFeatures = [ "nixos-test" "big-parallel" "kvm" ]; - } - ]; - - sops.secrets = { - "ssh_keys/root/remotebuild" = { - path = "/root/.ssh/remotebuild"; - }; + openssh.authorizedKeys.keyFiles = [ + ./remotebuild.pub + ]; }; + + users.groups.remotebuild = {}; + + nix.settings.trusted-users = ["remotebuild"]; }