infrastructure/machines/nixos/build01/nix-builder.nix
soyouzpanda 8cfc0001b9
Some checks failed
Check meta / check_dns (pull_request) Successful in 16s
Check workflows / check_workflows (pull_request) Successful in 17s
Build all the nodes / netcore02 (pull_request) Successful in 22s
Check meta / check_meta (pull_request) Successful in 31s
Build all the nodes / ap01 (pull_request) Successful in 34s
Build the shell / build-shell (pull_request) Successful in 25s
Run pre-commit on all files / pre-commit (pull_request) Successful in 24s
Build all the nodes / hypervisor02 (pull_request) Successful in 1m56s
Build all the nodes / build01 (pull_request) Successful in 1m59s
Build all the nodes / bridge01 (pull_request) Successful in 2m6s
Build all the nodes / tower01 (pull_request) Successful in 2m4s
Build all the nodes / geo02 (pull_request) Successful in 2m6s
Build all the nodes / rescue01 (pull_request) Successful in 2m13s
Build all the nodes / web02 (pull_request) Successful in 2m15s
Build all the nodes / hypervisor03 (pull_request) Successful in 2m20s
Build all the nodes / storage01 (pull_request) Successful in 2m26s
Build all the nodes / geo01 (pull_request) Successful in 2m26s
Build all the nodes / vault01 (pull_request) Successful in 2m28s
Build all the nodes / hypervisor01 (pull_request) Successful in 2m35s
Build all the nodes / web03 (pull_request) Successful in 2m33s
Build all the nodes / web01 (pull_request) Successful in 2m49s
Build all the nodes / compute01 (pull_request) Successful in 2m59s
Check meta / check_meta (push) Successful in 15s
Check meta / check_dns (push) Successful in 31s
Build all the nodes / ap01 (push) Successful in 33s
Build all the nodes / netcore02 (push) Successful in 41s
Build all the nodes / rescue01 (push) Has been cancelled
Build all the nodes / web03 (push) Has been cancelled
Build all the nodes / storage01 (push) Has been cancelled
Build all the nodes / hypervisor01 (push) Has been cancelled
Build all the nodes / geo02 (push) Has been cancelled
Build all the nodes / build01 (push) Has been cancelled
Build all the nodes / tower01 (push) Has been cancelled
Build all the nodes / bridge01 (push) Has been cancelled
Build all the nodes / compute01 (push) Has been cancelled
Build all the nodes / web02 (push) Has been cancelled
Build all the nodes / geo01 (push) Has been cancelled
Build all the nodes / hypervisor02 (push) Has been cancelled
Build all the nodes / web01 (push) Has been cancelled
Build all the nodes / vault01 (push) Has been cancelled
Build all the nodes / hypervisor03 (push) Has been cancelled
Run pre-commit on all files / pre-commit (push) Has been cancelled
Build the shell / build-shell (push) Has been cancelled
feat(build01): Init
2025-01-09 23:08:08 +01:00

70 lines
1.5 KiB
Nix

# SPDX-FileCopyrightText: 2025 Elias Coppens <elias@dgnum.eu>
#
# SPDX-License-Identifier: EUPL-1.2
{
pkgs,
lib,
meta,
...
}:
let
keys = (import ../../../keys)._keys;
in
{
config = {
users.users = lib.genAttrs meta.organization.groups.nix-builder (u: {
isNormalUser = true;
openssh.authorizedKeys.keys = keys.${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"
];
};
};
};
}