From 7f6a6772dd5f2b46af77264a20c20b8ac983af8b Mon Sep 17 00:00:00 2001 From: SebastianStork Date: Sun, 8 Mar 2026 12:45:07 +0100 Subject: [PATCH 1/3] desktop, laptop, srv-core: Use `swap` instead of `zram swap` --- hosts/desktop/hardware.nix | 4 ++++ hosts/laptop/hardware.nix | 4 ++++ hosts/srv-core/hardware.nix | 4 ++++ hosts/vps-ns/hardware.nix | 2 ++ hosts/vps-www/hardware.nix | 2 ++ profiles/core.nix | 2 -- 6 files changed, 16 insertions(+), 2 deletions(-) diff --git a/hosts/desktop/hardware.nix b/hosts/desktop/hardware.nix index a69b7d9..4e4df2f 100644 --- a/hosts/desktop/hardware.nix +++ b/hosts/desktop/hardware.nix @@ -20,6 +20,10 @@ _: { "usbhid" "sd_mod" ]; + kernelParams = [ + "zswap.enabled=1" + "zswap.shrinker_enabled=1" + ]; }; # Prevent immediate wake-up from suspend caused by the logi bolt receiver diff --git a/hosts/laptop/hardware.nix b/hosts/laptop/hardware.nix index f3153a5..e38b8ca 100644 --- a/hosts/laptop/hardware.nix +++ b/hosts/laptop/hardware.nix @@ -18,6 +18,10 @@ "usb_storage" "sd_mod" ]; + kernelParams = [ + "zswap.enabled=1" + "zswap.shrinker_enabled=1" + ]; }; services = { diff --git a/hosts/srv-core/hardware.nix b/hosts/srv-core/hardware.nix index ac0e37c..888a405 100644 --- a/hosts/srv-core/hardware.nix +++ b/hosts/srv-core/hardware.nix @@ -10,6 +10,10 @@ _: { "sd_mod" "sdhci_pci" ]; + kernelParams = [ + "zswap.enabled=1" + "zswap.shrinker_enabled=1" + ]; supportedFilesystems = [ "bcachefs" ]; diff --git a/hosts/vps-ns/hardware.nix b/hosts/vps-ns/hardware.nix index 073f92f..ea58368 100644 --- a/hosts/vps-ns/hardware.nix +++ b/hosts/vps-ns/hardware.nix @@ -12,4 +12,6 @@ "sd_mod" "sr_mod" ]; + + zramSwap.enable = true; } diff --git a/hosts/vps-www/hardware.nix b/hosts/vps-www/hardware.nix index 073f92f..ea58368 100644 --- a/hosts/vps-www/hardware.nix +++ b/hosts/vps-www/hardware.nix @@ -12,4 +12,6 @@ "sd_mod" "sr_mod" ]; + + zramSwap.enable = true; } diff --git a/profiles/core.nix b/profiles/core.nix index 53f02d1..c2913bc 100644 --- a/profiles/core.nix +++ b/profiles/core.nix @@ -93,8 +93,6 @@ vimAlias = true; }; - zramSwap.enable = true; - environment.systemPackages = [ (lib.hiPrio pkgs.uutils-coreutils-noprefix) pkgs.git From 97e5601cf286a89c566f50c756d498e99393a05d Mon Sep 17 00:00:00 2001 From: SebastianStork Date: Sun, 8 Mar 2026 12:45:49 +0100 Subject: [PATCH 2/3] desktop, laptop, srv-core: Enable discards on the swap partition --- hosts/desktop/disko.nix | 1 + hosts/laptop/disko.nix | 1 + hosts/srv-core/disko.nix | 5 ++++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/hosts/desktop/disko.nix b/hosts/desktop/disko.nix index 4eafc11..1c8789e 100644 --- a/hosts/desktop/disko.nix +++ b/hosts/desktop/disko.nix @@ -45,6 +45,7 @@ size = "20G"; content = { type = "swap"; + discardPolicy = "both"; resumeDevice = true; }; }; diff --git a/hosts/laptop/disko.nix b/hosts/laptop/disko.nix index 4a0923f..7dbe535 100644 --- a/hosts/laptop/disko.nix +++ b/hosts/laptop/disko.nix @@ -42,6 +42,7 @@ size = "20G"; content = { type = "swap"; + discardPolicy = "both"; resumeDevice = true; }; }; diff --git a/hosts/srv-core/disko.nix b/hosts/srv-core/disko.nix index b1c4d38..8cd022a 100644 --- a/hosts/srv-core/disko.nix +++ b/hosts/srv-core/disko.nix @@ -16,7 +16,10 @@ partitions = { swap = { size = "8G"; - content.type = "swap"; + content = { + type = "swap"; + discardPolicy = "both"; + }; }; root = { size = "100%"; From 73b1eedd22a858d20b5db47fe8a18f8265fba8af Mon Sep 17 00:00:00 2001 From: SebastianStork Date: Sun, 8 Mar 2026 12:46:08 +0100 Subject: [PATCH 3/3] bluethoot: Don't start on boot --- modules/nixos/services/bluetooth.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nixos/services/bluetooth.nix b/modules/nixos/services/bluetooth.nix index 31d4f36..aa9d0ae 100644 --- a/modules/nixos/services/bluetooth.nix +++ b/modules/nixos/services/bluetooth.nix @@ -6,7 +6,7 @@ hardware = { bluetooth = { enable = true; - powerOnBoot = true; + powerOnBoot = false; }; logitech.wireless.enable = true; };