From f255023f453c5271e4dc991cf10c087b810ff1dd Mon Sep 17 00:00:00 2001 From: Trolli Schmittlauch Date: Mon, 22 Oct 2018 23:49:39 +0200 Subject: [PATCH] swap optimisations for SSD: reduce swappiness, enable ZRAM; also use all cores for package building --- nixos/configuration.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index e8b2bdc..fefb806 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -33,6 +33,12 @@ in { # exfat support boot.extraModulePackages = [ config.boot.kernelPackages.exfat-nofuse ]; + zramSwap = + { enable = true; + memoryPercent = 20; + }; + boot.kernel.sysctl."vm.swappiness" = 9; + # powermanagement services.tlp = { enable = true; @@ -145,6 +151,8 @@ in { gc-keep-outputs = true gc-keep-derivations = true ''; + # use all cores for building + nix.buildCores = 0; # This value determines the NixOS release with which your system is to be # compatible, in order to avoid breaking some software such as database