Compare commits
2 Commits
e1ec03607a
...
nix
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3c17d56664
|
||
|
|
adff9fcd29 |
8
nix/configuration/flake.lock
generated
8
nix/configuration/flake.lock
generated
@@ -170,11 +170,11 @@
|
|||||||
"rust-overlay": "rust-overlay_2"
|
"rust-overlay": "rust-overlay_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1785248363,
|
"lastModified": 1785893798,
|
||||||
"narHash": "sha256-hx9Cn1vIa/h54t+s3ObO6+Z3xHSA1zc3YVRWxTZcigc=",
|
"narHash": "sha256-69nKdvM+E/66sj9R2HEK8i0p0TOt/0MSqfXiZjcJ9nI=",
|
||||||
"ref": "refs/heads/main",
|
"ref": "refs/heads/main",
|
||||||
"rev": "0addf91edf82775a0dc5022a81065ef101305e64",
|
"rev": "6386febdb81eb1e072ad7cb568019f06618008fe",
|
||||||
"revCount": 38,
|
"revCount": 41,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://code.fizz.buzz/talexander/nix_builder.git"
|
"url": "https://code.fizz.buzz/talexander/nix_builder.git"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -4,13 +4,15 @@
|
|||||||
config = {
|
config = {
|
||||||
me.distributed_build.enable = true;
|
me.distributed_build.enable = true;
|
||||||
me.distributed_build.machines.quark = {
|
me.distributed_build.machines.quark = {
|
||||||
enable = false;
|
enable_build = false;
|
||||||
|
enable_substituter = false;
|
||||||
additional_config = {
|
additional_config = {
|
||||||
speedFactor = 2;
|
speedFactor = 2;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
me.distributed_build.machines.hydra = {
|
me.distributed_build.machines.hydra = {
|
||||||
enable = true;
|
enable_build = false;
|
||||||
|
enable_substituter = true;
|
||||||
additional_config = {
|
additional_config = {
|
||||||
speedFactor = 2;
|
speedFactor = 2;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,10 +4,19 @@
|
|||||||
config = {
|
config = {
|
||||||
me.distributed_build.enable = true;
|
me.distributed_build.enable = true;
|
||||||
me.distributed_build.machines.quark = {
|
me.distributed_build.machines.quark = {
|
||||||
enable = true;
|
enable_build = false;
|
||||||
|
enable_substituter = false;
|
||||||
additional_config = {
|
additional_config = {
|
||||||
speedFactor = 2;
|
speedFactor = 2;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
me.distributed_build.machines.hydra = {
|
||||||
|
enable_build = false;
|
||||||
|
enable_substituter = true;
|
||||||
|
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=local?root=/.disk/root";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,13 +4,15 @@
|
|||||||
config = {
|
config = {
|
||||||
me.distributed_build.enable = true;
|
me.distributed_build.enable = true;
|
||||||
me.distributed_build.machines.quark = {
|
me.distributed_build.machines.quark = {
|
||||||
enable = false;
|
enable_build = false;
|
||||||
|
enable_substituter = false;
|
||||||
additional_config = {
|
additional_config = {
|
||||||
speedFactor = 2;
|
speedFactor = 2;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
me.distributed_build.machines.hydra = {
|
me.distributed_build.machines.hydra = {
|
||||||
enable = true;
|
enable_build = false;
|
||||||
|
enable_substituter = true;
|
||||||
additional_config = {
|
additional_config = {
|
||||||
speedFactor = 2;
|
speedFactor = 2;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,13 +4,15 @@
|
|||||||
config = {
|
config = {
|
||||||
me.distributed_build.enable = true;
|
me.distributed_build.enable = true;
|
||||||
me.distributed_build.machines.quark = {
|
me.distributed_build.machines.quark = {
|
||||||
enable = false;
|
enable_build = false;
|
||||||
|
enable_substituter = false;
|
||||||
additional_config = {
|
additional_config = {
|
||||||
speedFactor = 2;
|
speedFactor = 2;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
me.distributed_build.machines.hydra = {
|
me.distributed_build.machines.hydra = {
|
||||||
enable = true;
|
enable_build = false;
|
||||||
|
enable_substituter = true;
|
||||||
additional_config = {
|
additional_config = {
|
||||||
speedFactor = 2;
|
speedFactor = 2;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,8 +3,16 @@
|
|||||||
|
|
||||||
config = {
|
config = {
|
||||||
me.distributed_build.enable = true;
|
me.distributed_build.enable = true;
|
||||||
|
me.distributed_build.machines.quark = {
|
||||||
|
enable_build = false;
|
||||||
|
enable_substituter = false;
|
||||||
|
additional_config = {
|
||||||
|
speedFactor = 2;
|
||||||
|
};
|
||||||
|
};
|
||||||
me.distributed_build.machines.hydra = {
|
me.distributed_build.machines.hydra = {
|
||||||
enable = true;
|
enable_build = false;
|
||||||
|
enable_substituter = true;
|
||||||
additional_config = {
|
additional_config = {
|
||||||
speedFactor = 2;
|
speedFactor = 2;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,10 +4,19 @@
|
|||||||
config = {
|
config = {
|
||||||
me.distributed_build.enable = true;
|
me.distributed_build.enable = true;
|
||||||
me.distributed_build.machines.quark = {
|
me.distributed_build.machines.quark = {
|
||||||
enable = true;
|
enable_build = false;
|
||||||
|
enable_substituter = false;
|
||||||
additional_config = {
|
additional_config = {
|
||||||
speedFactor = 2;
|
speedFactor = 2;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
me.distributed_build.machines.hydra = {
|
||||||
|
enable_build = false;
|
||||||
|
enable_substituter = true;
|
||||||
|
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=local?root=/.disk/root";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,14 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
make_machine_config = name: {
|
make_machine_config = name: {
|
||||||
enable = lib.mkOption {
|
enable_build = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
description = "Whether we want to use the ${name} machine during distributed builds.";
|
||||||
|
};
|
||||||
|
|
||||||
|
enable_substituter = lib.mkOption {
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
@@ -59,11 +66,30 @@ let
|
|||||||
hostName = lib.mkForce "hydra?remote-store=local?root=/.disk/root";
|
hostName = lib.mkForce "hydra?remote-store=local?root=/.disk/root";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
build_machine_list = (
|
||||||
|
map (
|
||||||
|
hostname:
|
||||||
|
(lib.mkIf config.me.distributed_build.machines."${hostname}".enable_build (
|
||||||
|
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;
|
||||||
|
protocol = "ssh-ng";
|
||||||
|
}
|
||||||
|
static_host_configs."${hostname}"
|
||||||
|
config.me.distributed_build.machines."${hostname}".additional_config
|
||||||
|
]
|
||||||
|
))
|
||||||
|
) (builtins.attrNames all_nixos_configs)
|
||||||
|
);
|
||||||
substituters_list = (
|
substituters_list = (
|
||||||
map (
|
map (
|
||||||
hostname:
|
hostname:
|
||||||
(lib.mkIf (
|
(lib.mkIf (
|
||||||
config.me.distributed_build.machines."${hostname}".enable
|
config.me.distributed_build.machines."${hostname}".enable_substituter
|
||||||
&& config.me.distributed_build.machines."${hostname}".substituter_url != null
|
&& config.me.distributed_build.machines."${hostname}".substituter_url != null
|
||||||
) (config.me.distributed_build.machines."${hostname}".substituter_url))
|
) (config.me.distributed_build.machines."${hostname}".substituter_url))
|
||||||
) (builtins.attrNames all_nixos_configs)
|
) (builtins.attrNames all_nixos_configs)
|
||||||
@@ -112,25 +138,7 @@ in
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
nix.buildMachines = (
|
nix.buildMachines = build_machine_list;
|
||||||
map (
|
|
||||||
hostname:
|
|
||||||
(lib.mkIf config.me.distributed_build.machines."${hostname}".enable (
|
|
||||||
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;
|
|
||||||
protocol = "ssh-ng";
|
|
||||||
}
|
|
||||||
static_host_configs."${hostname}"
|
|
||||||
config.me.distributed_build.machines."${hostname}".additional_config
|
|
||||||
]
|
|
||||||
))
|
|
||||||
) (builtins.attrNames all_nixos_configs)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
(lib.mkIf has_any_substituters {
|
(lib.mkIf has_any_substituters {
|
||||||
nix.settings.substitute = lib.mkForce true;
|
nix.settings.substitute = lib.mkForce true;
|
||||||
|
|||||||
Reference in New Issue
Block a user