From 41d962082025f3deeeb8652955b57e12bc01db58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Thu, 1 Jan 2026 21:31:42 +0100 Subject: [PATCH] hetzner_benchmark: set up as nix builder --- nix/configurations/hetzner_benchmark.nix | 1 + .../hetzner_benchmark/nixos/builder.nix | 31 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 nix/configurations/hetzner_benchmark/nixos/builder.nix diff --git a/nix/configurations/hetzner_benchmark.nix b/nix/configurations/hetzner_benchmark.nix index d8235a48..3f84df39 100644 --- a/nix/configurations/hetzner_benchmark.nix +++ b/nix/configurations/hetzner_benchmark.nix @@ -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 diff --git a/nix/configurations/hetzner_benchmark/nixos/builder.nix b/nix/configurations/hetzner_benchmark/nixos/builder.nix new file mode 100644 index 00000000..c8191c8d --- /dev/null +++ b/nix/configurations/hetzner_benchmark/nixos/builder.nix @@ -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; + }; +}