fix distributed setup local

This commit is contained in:
Sam 2025-01-08 19:29:33 +00:00
parent 1e7af5c096
commit a58b62baa6
3 changed files with 35 additions and 4 deletions

View File

@ -487,11 +487,11 @@
}, },
"nix-secrets": { "nix-secrets": {
"locked": { "locked": {
"lastModified": 1736337009, "lastModified": 1736339437,
"narHash": "sha256-5seeOYCOJrvhbKIj64bAzeSJN80hdVp08ufArlBf+qg=", "narHash": "sha256-Em8E6Ml2whMU1IoEB3OI3eKhjSu2J/xbXdlIt+8x61U=",
"ref": "refs/heads/master", "ref": "refs/heads/master",
"rev": "bd63772717581b787f1f2aaac3fb909eaae2c2b7", "rev": "7c6042a975808186934e012ad32ae0e03ab60bff",
"revCount": 193, "revCount": 194,
"type": "git", "type": "git",
"url": "ssh://git@git.bitlab21.com/sam/nix-secrets.git" "url": "ssh://git@git.bitlab21.com/sam/nix-secrets.git"
}, },

View File

@ -1,4 +1,33 @@
{ 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;
nix.settings.trusted-substituters = ["ssh://${remoteMachineIp}"];
nix.settings.substituters = ["ssh://${remoteMachineIp}"];
nix.buildMachines = [
{
hostName = remoteMachineIp;
sshUser = "remotebuild";
speedFactor = 1;
maxJobs = 10;
sshKey = "/root/.ssh/remotebuild";
system = pkgs.stdenv.hostPlatform.system;
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";
# };
# };
sops.secrets = { sops.secrets = {
"ssh_keys/root/remotebuild" = { "ssh_keys/root/remotebuild" = {
path = "/root/.ssh/remotebuild"; path = "/root/.ssh/remotebuild";

View File

@ -59,6 +59,8 @@ in {
../common/optional/restic-backup.nix ../common/optional/restic-backup.nix
../common/optional/nixos-containers/backup-server.nix ../common/optional/nixos-containers/backup-server.nix
../common/optional/distributed_builds/local-machine.nix
]; ];
fileSystems."/media/main-ssd" = { fileSystems."/media/main-ssd" = {