File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 5454 "flakes"
5555 "nix-command"
5656 ] ;
57+
58+ # Swap: zram (primary) + swapfile (fallback) for memory-intensive builds
59+ zramSwap = {
60+ enable = true ;
61+ memoryPercent = 50 ; # 4GB zram (~12GB effective with compression)
62+ algorithm = "zstd" ;
63+ priority = 100 ;
64+ } ;
65+ swapDevices = [
66+ {
67+ device = "/var/lib/swapfile" ;
68+ size = 4 * 1024 ; # 4GB fallback
69+ priority = 10 ;
70+ }
71+ ] ;
72+ boot . kernel . sysctl . "vm.swappiness" = 100 ;
73+
74+ # Increase file descriptor limits for large builds
75+ security . pam . loginLimits = [
76+ {
77+ domain = "*" ;
78+ type = "soft" ;
79+ item = "nofile" ;
80+ value = "524288" ;
81+ }
82+ {
83+ domain = "*" ;
84+ type = "hard" ;
85+ item = "nofile" ;
86+ value = "524288" ;
87+ }
88+ ] ;
5789 } ;
5890 } ;
5991}
You can’t perform that action at this time.
0 commit comments