infrastructure/machines/nixos/build01/nix-builder.nix
sinavir 07d226a06e
All checks were successful
Build the shell / build-shell (push) Successful in 26s
Build all the nodes / netcore02 (push) Successful in 32s
Build all the nodes / ap01 (push) Successful in 33s
Run pre-commit on all files / pre-commit (push) Successful in 23s
Build all the nodes / geo01 (push) Successful in 1m34s
Build all the nodes / tower01 (push) Successful in 1m39s
Build all the nodes / hypervisor02 (push) Successful in 1m46s
Build all the nodes / hypervisor03 (push) Successful in 1m46s
Build all the nodes / bridge01 (push) Successful in 1m55s
Build all the nodes / geo02 (push) Successful in 1m59s
Build all the nodes / vault01 (push) Successful in 1m59s
Build all the nodes / web02 (push) Successful in 1m58s
Build all the nodes / rescue01 (push) Successful in 2m0s
Build all the nodes / hypervisor01 (push) Successful in 2m6s
Build all the nodes / web03 (push) Successful in 2m4s
Build all the nodes / compute01 (push) Successful in 2m17s
Build all the nodes / build01 (push) Successful in 2m18s
Build all the nodes / storage01 (push) Successful in 2m23s
Build all the nodes / web01 (push) Successful in 2m56s
fix(build01/nix-builder): Use dgn-access-control
2025-01-10 19:26:24 +01:00

64 lines
1.5 KiB
Nix

# SPDX-FileCopyrightText: 2025 Elias Coppens <elias@dgnum.eu>
#
# SPDX-License-Identifier: EUPL-1.2
{
pkgs,
lib,
meta,
...
}:
{
config = {
dgn-access-control.users = lib.genAttrs meta.organization.groups.nix-builder (u: lib.singleton u);
security.pam.loginLimits = [
{
domain = "*";
item = "nofile";
type = "-";
value = "20480";
}
];
systemd.services.nix-daemon.serviceConfig = {
MemoryAccounting = true;
MemoryMax = "450G";
MemoryHigh = "440G";
MemorySwapMax = "2G";
ManagedOOMSwap = "kill";
ManagedOOMMemoryPressure = "kill";
MemoryPressureWatch = "on";
};
nix = {
gc = {
automatic = true;
dates = lib.mkForce "*:45";
options = lib.mkForce ''--max-freed "$((128 * 1024**3 - 1024 * $(df -P -k /nix/store | tail -n 1 | ${pkgs.gawk}/bin/awk '{ print $4 }')))"'';
randomizedDelaySec = "1800";
};
nrBuildUsers = 128;
settings = {
keep-outputs = false;
keep-derivations = false;
use-cgroups = true;
http-connections = 0;
auto-allocate-uids = true;
cores = 0;
max-jobs = 8;
fsync-metadata = true;
experimental-features = [
"auto-allocate-uids"
# "ca-derivations" this feature is really extremely broken.
"cgroups"
"fetch-closure"
"impure-derivations"
];
};
};
};
}