Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions builders/common/nix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@
}:

{
fileSystems."/nix/var/nix/builds" = {
device = "none";
fsType = "tmpfs";
options = [
"huge=within_size"
"mode=0700"
"nosuid"
"nodev"
];
};

nix = {
package = pkgs.nix;
nrBuildUsers = config.nix.settings.max-jobs + 32;
Expand Down
3 changes: 0 additions & 3 deletions builders/common/system.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,4 @@

# use memory more efficiently at the cost of some compute
zramSwap.enable = true;

# enable huge pages for tmpfs on /tmp
boot.tmp.tmpfsHugeMemoryPages = "within_size";
}
13 changes: 7 additions & 6 deletions builders/profiles/hetzner-ax101r.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
boot.supportedFilesystems.zfs = true;
networking.hostId = "91312b0a";

boot.tmp = {
useTmpfs = true;
# 128G tmpfs, 128G RAM for standard builders
# 160G tmpfs, 96G RAM for big parallel builders
tmpfsSize = if lib.elem "big-parallel" config.nix.settings.system-features then "160G" else "128G";
};
# 128G tmpfs, 128G RAM (+zram swap) for standard builders
# 160GB tmpfs, 96 GB RAM (+zram swap) for big-parallel builders
fileSystems."/nix/var/nix/builds".options =
if lib.elem "big-parallel" config.nix.settings.system-features then
[ "size=160G" ]
else
[ "size=128G" ];

boot.initrd.availableKernelModules = [
"nvme"
Expand Down
15 changes: 2 additions & 13 deletions builders/profiles/hetzner-rx220.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
{
config,
lib,
...
}:

{
imports = [
../boot/efi-grub.nix
Expand All @@ -13,13 +7,8 @@
boot.supportedFilesystems.zfs = true;
networking.hostId = "91312b0a";

# 96G for build roots, 160G for working memory
boot.tmp = {
useTmpfs = true;
# 128G tmpfs, 128G RAM for standard builders
# 128G tmpfs, 128G RAM for big parallel builders
tmpfsSize = if lib.elem "big-parallel" config.nix.settings.system-features then "128G" else "128G";
};
# 128G tmpfs, 128G RAM (+zram swap)
fileSystems."/nix/var/nix/builds".options = [ "size=128G" ];

boot.initrd.availableKernelModules = [
"nvme"
Expand Down