mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-06 01:38:06 +00:00
[General/Nix] Improve remote builders support
This commit is contained in:
parent
52d7d35514
commit
0d927b6971
1 changed files with 26 additions and 14 deletions
38
general.nix
38
general.nix
|
|
@ -11,23 +11,26 @@ let
|
||||||
mkBuildMachine = {
|
mkBuildMachine = {
|
||||||
hostName,
|
hostName,
|
||||||
cores,
|
cores,
|
||||||
|
system ? "x86_64-linux" ,
|
||||||
threads ? (cores * 2),
|
threads ? (cores * 2),
|
||||||
features ? [ ],
|
features ? [ ],
|
||||||
x86ver ? 1
|
x86ver ? 1 ,
|
||||||
}:
|
...
|
||||||
rec {
|
}@attrs: rec {
|
||||||
inherit hostName;
|
inherit hostName system;
|
||||||
system = "x86_64-linux";
|
|
||||||
maxJobs = cores / 2;
|
|
||||||
sshUser = "builder";
|
sshUser = "builder";
|
||||||
sshKey = toString buildUserKeyFile;
|
sshKey = toString buildUserKeyFile;
|
||||||
speedFactor = getSpeed cores threads;
|
speedFactor = getSpeed cores threads;
|
||||||
|
maxJobs = myLib.math.log2 cores;
|
||||||
supportedFeatures = [ "kvm" "benchmark" ]
|
supportedFeatures = [ "kvm" "benchmark" ]
|
||||||
|
++ optional (system == "x86_64-linux") "i686-linux"
|
||||||
++ optional (speedFactor > 8) "big-parallel"
|
++ optional (speedFactor > 8) "big-parallel"
|
||||||
++ optional (x86ver >= 2) "gccarch-x86-64-v2"
|
++ optional (x86ver >= 2) "gccarch-x86-64-v2"
|
||||||
++ optional (x86ver >= 3) "gccarch-x86-64-v3"
|
++ optional (x86ver >= 3) "gccarch-x86-64-v3"
|
||||||
|
++ optional (x86ver >= 4) "gccarch-x86-64-v4"
|
||||||
++ features
|
++ features
|
||||||
;
|
;
|
||||||
|
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
@ -123,14 +126,23 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
nix.buildMachines = [
|
nix.buildMachines = [
|
||||||
{
|
(mkBuildMachine {
|
||||||
hostName = "lesviallon.fr";
|
hostName = "luke-skywalker-nixos.local";
|
||||||
system = "x86_64-linux";
|
cores = 8;
|
||||||
maxJobs = 2;
|
threads = 16;
|
||||||
speedFactor = 4;
|
})
|
||||||
supportedFeatures = [ "kvm" "benchmark" "big-parallel" ];
|
(mkBuildMachine {
|
||||||
}
|
hostName = "cachan.lesviallon.fr";
|
||||||
|
cores = 6;
|
||||||
|
threads = 6;
|
||||||
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
|
programs.ssh.extraConfig = ''
|
||||||
|
Host cachan.lesviallon.fr
|
||||||
|
Port 52222
|
||||||
|
'';
|
||||||
|
|
||||||
users.users.builder = {
|
users.users.builder = {
|
||||||
isSystemUser = true;
|
isSystemUser = true;
|
||||||
group = "builder";
|
group = "builder";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue