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 51295a23dc
6 changed files with 21 additions and 25 deletions

View File

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

View File

@@ -129,6 +129,8 @@
# systemd.user.extraConfig = "DefaultLimitNOFILE=8192"; # systemd.user.extraConfig = "DefaultLimitNOFILE=8192";
# systemd.services."user@11400".serviceConfig.LimitNOFILE = "8192"; # systemd.services."user@11400".serviceConfig.LimitNOFILE = "8192";
nix.settings.secret-key-files = [ "/persist/manual/nix/nix-cache-key.sec" ];
me.build_in_ram.enable = true; me.build_in_ram.enable = true;
me.dont_use_substituters.enable = true; me.dont_use_substituters.enable = true;
me.hydra.enable = true; me.hydra.enable = true;

View File

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

View File

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

View File

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

View File

@@ -59,25 +59,16 @@ let
hostName = lib.mkForce "hydra?remote-store=local?root=/.disk/root"; hostName = lib.mkForce "hydra?remote-store=local?root=/.disk/root";
}; };
}; };
joined_configs = substituters_list = (
lib.genAttrs map (
(builtins.filter (hostname: config.me.distributed_build.machines."${hostname}".enable) ( hostname:
builtins.attrNames all_nixos_configs (lib.mkIf (
)) config.me.distributed_build.machines."${hostname}".enable
( && config.me.distributed_build.machines."${hostname}".substituter_url != null
hostname: ) (config.me.distributed_build.machines."${hostname}".substituter_url))
(lib.mkMerge [ ) (builtins.attrNames all_nixos_configs)
{ );
hostName = hostname; has_any_substituters = substituters_list != [ ];
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
])
);
in in
{ {
imports = [ ]; imports = [ ];
@@ -117,6 +108,7 @@ in
"odo:0S/XKSFjjIrihQ7lbHEIebXk/c/xuoodhm0Gz26YhjA=" "odo:0S/XKSFjjIrihQ7lbHEIebXk/c/xuoodhm0Gz26YhjA="
"odowork:zg3UKBAyLy3xtZkL0hMtbxHjxgn5A2QY8NNAgyRT6Yo=" "odowork:zg3UKBAyLy3xtZkL0hMtbxHjxgn5A2QY8NNAgyRT6Yo="
"quark:Eb6ygkIiVlcUqb5hOjEVIQcfYLpCz40YVYA3/rxrgBc=" "quark:Eb6ygkIiVlcUqb5hOjEVIQcfYLpCz40YVYA3/rxrgBc="
"hydra:1s4Cy9YJLgw4jWx5jdSCfJmIm0hfya7WEy/EwJYI5Ys="
]; ];
} }
{ {
@@ -140,12 +132,10 @@ in
) (builtins.attrNames all_nixos_configs) ) (builtins.attrNames all_nixos_configs)
); );
} }
# { (lib.mkIf has_any_substituters {
# nix.settings.substitute = lib.mkForce true; nix.settings.substitute = lib.mkForce true;
# nix.settings.substituters = lib.mkForce ( nix.settings.substituters = lib.mkForce substituters_list;
# lib.mapAttrsToList (hostname: joined_config: "ssh-ng://${joined_config.hostName}") joined_configs })
# );
# }
] ]
); );
} }