Enable the build VM as a substituter.

This should enable me to have local build jobs without rebuilding stuff that already exists on the build VM server.
This commit is contained in:
Tom Alexander
2026-07-17 20:58:06 -04:00
parent 11d8b93551
commit fe2006ab94
5 changed files with 18 additions and 25 deletions

View File

@@ -14,6 +14,7 @@
additional_config = {
speedFactor = 2;
};
substituter_url = "ssh-ng://nixworker@ns1.fizz.buzz:65122?compress=true&ssh-key=/persist/manual/ssh/root/keys/id_ed25519&remote-store=/.disk/root";
};
};
}

View File

@@ -14,6 +14,7 @@
additional_config = {
speedFactor = 2;
};
substituter_url = "ssh-ng://nixworker@ns1.fizz.buzz:65122?compress=true&ssh-key=/persist/manual/ssh/root/keys/id_ed25519&remote-store=/.disk/root";
};
};
}

View File

@@ -14,6 +14,7 @@
additional_config = {
speedFactor = 2;
};
substituter_url = "ssh-ng://nixworker@ns1.fizz.buzz:65122?compress=true&ssh-key=/persist/manual/ssh/root/keys/id_ed25519&remote-store=/.disk/root";
};
};
}

View File

@@ -8,6 +8,7 @@
additional_config = {
speedFactor = 2;
};
substituter_url = "ssh-ng://nixworker@ns1.fizz.buzz:65122?compress=true&ssh-key=/persist/manual/ssh/root/keys/id_ed25519&remote-store=/.disk/root";
};
};
}

View File

@@ -59,25 +59,16 @@ let
hostName = lib.mkForce "hydra?remote-store=local?root=/.disk/root";
};
};
joined_configs =
lib.genAttrs
(builtins.filter (hostname: config.me.distributed_build.machines."${hostname}".enable) (
builtins.attrNames all_nixos_configs
))
(
hostname:
(lib.mkMerge [
{
hostName = hostname;
sshUser = "nixworker";
sshKey = "/persist/manual/ssh/root/keys/id_ed25519";
maxJobs = 1;
supportedFeatures = all_nixos_configs."${hostname}".config.me.optimizations.system_features;
}
static_host_configs."${hostname}"
config.me.distributed_build.machines."${hostname}".additional_config
])
);
substituters_list = (
map (
hostname:
(lib.mkIf (
config.me.distributed_build.machines."${hostname}".enable
&& config.me.distributed_build.machines."${hostname}".substituter_url != null
) (config.me.distributed_build.machines."${hostname}".substituter_url))
) (builtins.attrNames all_nixos_configs)
);
has_any_substituters = substituters_list != [ ];
in
{
imports = [ ];
@@ -140,12 +131,10 @@ in
) (builtins.attrNames all_nixos_configs)
);
}
# {
# nix.settings.substitute = lib.mkForce true;
# nix.settings.substituters = lib.mkForce (
# lib.mapAttrsToList (hostname: joined_config: "ssh-ng://${joined_config.hostName}") joined_configs
# );
# }
(lib.mkIf has_any_substituters {
nix.settings.substitute = lib.mkForce true;
nix.settings.substituters = lib.mkForce substituters_list;
})
]
);
}