hetzner_benchmark: set up as nix builder

This commit is contained in:
Primrose 2026-01-01 21:31:42 +01:00
parent dd15a482a5
commit 41d9620820
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA
2 changed files with 32 additions and 0 deletions

View file

@ -57,6 +57,7 @@ in
./hetzner_benchmark/nixos/hardware-configuration.nix
./hetzner_benchmark/nixos/misc.nix
./hetzner_benchmark/nixos/programs.nix
./hetzner_benchmark/nixos/builder.nix
../nixosModules/common/fish.nix
../nixosModules/common/disable-command-not-found.nix

View file

@ -0,0 +1,31 @@
# https://nix.dev/tutorials/nixos/distributed-builds-setup.html
{ config, ... }:
{
users.users.remotebuild = {
isSystemUser = true;
group = "remotebuild";
useDefaultShell = true;
openssh.authorizedKeys.keys = config.users.users.root.openssh.authorizedKeys.keys;
};
users.groups.remotebuild = { };
nix = {
nrBuildUsers = 64; # defaults to 32
settings = {
trusted-users = [ "remotebuild" ];
min-free = 50 * 1024 * 1024 * 1024; # start gc when < 10 GB is available
max-free = 100 * 1024 * 1024 * 1024; # stop gc when 20 GB is available
max-jobs = "auto";
cores = 0;
};
};
systemd.services.nix-daemon.serviceConfig = {
MemoryAccounting = true;
MemoryMax = "90%";
OOMScoreAdjust = 500;
};
}