From 6b673ac3b10598f27cfcd90f58f3abc38a0eaac5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vili=20Sinerv=C3=A4?= Date: Tue, 27 Aug 2024 18:35:04 +0300 Subject: [PATCH] Change memory management slightly, enable zram by default --- base.nix | 9 +++++++++ machine-confs/generic.nix | 7 ------- machine-confs/helium.nix | 12 ------------ machine-confs/lithium.nix | 7 ------- machine-confs/wg-rpi.nix | 2 +- 5 files changed, 10 insertions(+), 27 deletions(-) diff --git a/base.nix b/base.nix index 9488278..3688b27 100644 --- a/base.nix +++ b/base.nix @@ -116,6 +116,15 @@ }; time.timeZone = "Europe/Helsinki"; + #################### Memory management #################### + zramSwap.enable = true; + swapDevices = [ + { + device = "/var/lib/swapfile"; + size = 16 * 1024; + } + ]; + #################### Housekeeping #################### system.autoUpgrade = { enable = true; diff --git a/machine-confs/generic.nix b/machine-confs/generic.nix index e4f7165..0ecb2dc 100644 --- a/machine-confs/generic.nix +++ b/machine-confs/generic.nix @@ -12,11 +12,4 @@ #Prevent user from being locked out of the system before switching to proper config users.mutableUsers = pkgs.lib.mkForce true; - - swapDevices = [ - { - device = "/var/lib/swapfile"; - size = 8 * 1024; - } - ]; } diff --git a/machine-confs/helium.nix b/machine-confs/helium.nix index db08908..64d7f67 100644 --- a/machine-confs/helium.nix +++ b/machine-confs/helium.nix @@ -53,11 +53,6 @@ RestartSec = "1s"; }; - nix.settings = { - cores = 3; - max-jobs = 4; - }; - services.openssh.enable = pkgs.lib.mkForce false; services.fail2ban.enable = pkgs.lib.mkForce false; @@ -88,11 +83,4 @@ efi.canTouchEfiVariables = true; }; }; - - swapDevices = [ - { - device = "/var/lib/swapfile"; - size = 16 * 1024; - } - ]; } diff --git a/machine-confs/lithium.nix b/machine-confs/lithium.nix index 69eec90..70ff34c 100644 --- a/machine-confs/lithium.nix +++ b/machine-confs/lithium.nix @@ -20,11 +20,4 @@ efi.canTouchEfiVariables = true; }; }; - - swapDevices = [ - { - device = "/var/lib/swapfile"; - size = 16 * 1024; - } - ]; } diff --git a/machine-confs/wg-rpi.nix b/machine-confs/wg-rpi.nix index de0caf5..c59c6e5 100644 --- a/machine-confs/wg-rpi.nix +++ b/machine-confs/wg-rpi.nix @@ -100,7 +100,7 @@ in max-jobs = 2; }; - swapDevices = [ + swapDevices = pkgs.lib.mkForce [ { device = "/var/lib/swapfile"; size = 8 * 1024;