mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-05 17:27:50 +00:00
[Nix+Optimizations] Fix distributed builds.
Also fix kernel and openssh if optimizations are turned off.
This commit is contained in:
parent
52407e3f4e
commit
2f20fad072
3 changed files with 18 additions and 14 deletions
2
boot.nix
2
boot.nix
|
|
@ -153,7 +153,7 @@ in
|
|||
kernelPatches = []
|
||||
++ optional cfg.x32abi.enable customKernelPatches.enableX32ABI
|
||||
++ optional cfg.rtGroupSched.enable customKernelPatches.enableRTGroupSched
|
||||
++ optional config.aviallon.overlays.optimizations (customKernelPatches.optimizeForCPUArch config.aviallon.general.cpuArch)
|
||||
++ optional config.aviallon.optimizations.enable (customKernelPatches.optimizeForCPUArch config.aviallon.general.cpuArch)
|
||||
;
|
||||
|
||||
loader.grub.enable = cfg.useGrub;
|
||||
|
|
|
|||
28
general.nix
28
general.nix
|
|
@ -3,28 +3,30 @@ with lib;
|
|||
let
|
||||
cfg = config.aviallon.general;
|
||||
desktopCfg = config.aviallon.desktop;
|
||||
buildUserKeyFile = "remote_builder/id_builder";
|
||||
buildUserPubKey = readFile ./nix/id_builder.pub;
|
||||
buildUserKey = readFile ./nix/id_builder;
|
||||
buildUserPubKeyFile = ./nix/id_builder.pub;
|
||||
buildUserKeyFile = ./nix/id_builder;
|
||||
|
||||
getSpeed = cores: threads: cores + (threads - cores) / 2;
|
||||
|
||||
mkBuildMachine = {
|
||||
hostName,
|
||||
cores,
|
||||
threads ? (cores * 2),
|
||||
features ? [ ],
|
||||
x86ver ? 1 }:
|
||||
hostName,
|
||||
cores,
|
||||
threads ? (cores * 2),
|
||||
features ? [ ],
|
||||
x86ver ? 1
|
||||
}:
|
||||
rec {
|
||||
inherit hostName;
|
||||
system = "x86_64-linux";
|
||||
maxJobs = cores / 2;
|
||||
sshUser = "builder";
|
||||
sshKey = "/etc/${buildUserKeyFile}";
|
||||
sshKey = toString buildUserKeyFile;
|
||||
speedFactor = getSpeed cores threads;
|
||||
supportedFeatures = [ "kvm" "benchmark" ]
|
||||
++ optional (speedFactor > 8) "big-parallel"
|
||||
++ optional (x86ver >= 2) "gccarch-x86-64-v2"
|
||||
++ optional (x86ver >= 3) "gccarch-x86-64-v3"
|
||||
++ features
|
||||
;
|
||||
};
|
||||
in
|
||||
|
|
@ -116,7 +118,6 @@ in
|
|||
gcc.tune = cfg.cpuTune;
|
||||
};
|
||||
|
||||
environment.etc."${buildUserKeyFile}".text = buildUserKey;
|
||||
nix.buildMachines = [
|
||||
{
|
||||
hostName = "lesviallon.fr";
|
||||
|
|
@ -130,13 +131,14 @@ in
|
|||
isSystemUser = true;
|
||||
group = "builder";
|
||||
hashedPassword = mkForce null; # Must not have a password!
|
||||
openssh.authorizedKeys.keys = [
|
||||
buildUserPubKey
|
||||
openssh.authorizedKeys.keyFiles = [
|
||||
buildUserKeyFile
|
||||
];
|
||||
shell = pkgs.bashInteractive;
|
||||
};
|
||||
users.groups.builder = {};
|
||||
nix.trustedUsers = [ "builder" ];
|
||||
nix.distributedBuilds = mkDefault false;
|
||||
nix.distributedBuilds = mkDefault true;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,6 +79,8 @@ in
|
|||
enableWideVine = true;
|
||||
};
|
||||
|
||||
opensshOptimized = super.opensshOptimized or super.openssh;
|
||||
|
||||
scribus = super.scribus.overrideAttrs (old: rec {
|
||||
version = "1.5.8";
|
||||
sha256 = "sha256-R4Fuj89tBXiP8WqkSZ+X/yJDHHd6d4kUmwqItFHha3Q=";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue