restructure

Signed-off-by: unexplrd <unexplrd@linerds.us>
This commit is contained in:
2025-06-17 12:45:52 +03:00
parent 02a8c645e9
commit 0bdff5ef5b
37 changed files with 167 additions and 194 deletions

View File

@ -0,0 +1,49 @@
{
config,
inputs,
lib,
...
}: let
isBuildHost = config.networking.hostName == "dunamis";
in {
config = lib.mkMerge [
(lib.mkIf isBuildHost {
nix = let
inherit (builtins) readFile;
inherit (config.users.users) user;
in {
sshServe = {
enable = true;
keys = map (f: readFile f) user.openssh.authorizedKeys.keyFiles;
protocol = "ssh-ng";
trusted = true;
write = true;
};
};
})
(lib.mkIf (!isBuildHost) {
nix = let
inherit (builtins) readFile;
inherit (config.networking) hostName;
inherit (config.sops) secrets;
inherit (inputs) mysecrets;
pubHost = readFile "${mysecrets}/ssh/ssh_host_ed25519_dunamis.base64";
in {
distributedBuilds = true;
buildMachines = [
{
hostName = "dunamis";
maxJobs = 3;
protocol = "ssh-ng";
publicHostKey = pubHost;
speedFactor = 2;
sshKey = secrets."ssh-${hostName}-user".path;
sshUser = "nix-ssh";
supportedFeatures = ["benchmark" "big-parallel" "kvm" "nixos-test"];
system = "x86_64-linux";
}
];
};
})
];
}