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:
@@ -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;
|
||||
})
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user