From 618a4b3a7331b0c6704bb8f154c96c9c309d49cd Mon Sep 17 00:00:00 2001 From: Tim Schubert Date: Sun, 27 Jul 2025 00:21:39 +0200 Subject: [PATCH 1/5] fix(stolas): suspend from disk and wifi suspend --- nixos/stolas/default.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nixos/stolas/default.nix b/nixos/stolas/default.nix index 696f55f..016d986 100644 --- a/nixos/stolas/default.nix +++ b/nixos/stolas/default.nix @@ -23,7 +23,12 @@ pkiBundle = "/var/lib/sbctl"; }; kernelModules = [ "kvm-amd" ]; - extraModulePackages = [ pkgs.linuxPackages.v4l2loopback ]; + # Hopefully fixes suspend issues with wifi card + kernelPackages = pkgs.linuxPackages_latest; + kernelParams = [ + "resume=UUID=81dfbfa5-d578-479c-b11c-3ee5abd6848a" + ]; + extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ]; # Lanzaboote currently replaces the systemd-boot module. # This setting is usually set to true in configuration.nix # generated at installation time. So we force it to false @@ -205,7 +210,6 @@ "wireshark" "paperless" ]; - shell = "/run/current-system/sw/bin/zsh"; }; }; }; From 0909933ba9b1f113224f1979e1b5565bbccc1b97 Mon Sep 17 00:00:00 2001 From: Tim Schubert Date: Sun, 27 Jul 2025 00:22:20 +0200 Subject: [PATCH 2/5] chore(stolas): cleanup config --- nixos/stolas/default.nix | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/nixos/stolas/default.nix b/nixos/stolas/default.nix index 016d986..4bc3756 100644 --- a/nixos/stolas/default.nix +++ b/nixos/stolas/default.nix @@ -27,6 +27,7 @@ kernelPackages = pkgs.linuxPackages_latest; kernelParams = [ "resume=UUID=81dfbfa5-d578-479c-b11c-3ee5abd6848a" + "resume_offset=533760" ]; extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ]; # Lanzaboote currently replaces the systemd-boot module. @@ -70,10 +71,6 @@ powerManagement = { enable = true; cpuFreqGovernor = "schedutil"; - # TODO: Limit charge of battery, does this work without kernel patches from hardware.frameworkenableKmod? - powerUpCommands = '' - echo 80 > /sys/class/power_supply/BAT0/charge_control_stop_threshold - ''; }; networking = { @@ -214,15 +211,6 @@ }; }; - # TODO - # age.secrets = { - # paperless = { - # file = "${config.dadada.secrets.path}/paperless.age"; - # mode = "700"; - # owner = "paperless"; - # }; - # }; - # Create compressing swap space in RAM zramSwap.enable = true; } From 03c6c141ee8a9ad848b97483ca242a9bc801dc78 Mon Sep 17 00:00:00 2001 From: Tim Schubert Date: Sun, 27 Jul 2025 00:55:31 +0200 Subject: [PATCH 3/5] feat(stolas): replace zram with zswap --- nixos/stolas/default.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/nixos/stolas/default.nix b/nixos/stolas/default.nix index 4bc3756..08756ee 100644 --- a/nixos/stolas/default.nix +++ b/nixos/stolas/default.nix @@ -26,8 +26,8 @@ # Hopefully fixes suspend issues with wifi card kernelPackages = pkgs.linuxPackages_latest; kernelParams = [ - "resume=UUID=81dfbfa5-d578-479c-b11c-3ee5abd6848a" "resume_offset=533760" + "zswap.enabled=1" ]; extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ]; # Lanzaboote currently replaces the systemd-boot module. @@ -210,7 +210,4 @@ }; }; }; - - # Create compressing swap space in RAM - zramSwap.enable = true; } From 9ec068865291b811f4ff25685a03f021bdce4162 Mon Sep 17 00:00:00 2001 From: Tim Schubert Date: Sun, 27 Jul 2025 01:00:17 +0200 Subject: [PATCH 4/5] chore(stolas): remove unused option for combined sleep target --- nixos/stolas/default.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/nixos/stolas/default.nix b/nixos/stolas/default.nix index 08756ee..9c3ed83 100644 --- a/nixos/stolas/default.nix +++ b/nixos/stolas/default.nix @@ -176,10 +176,6 @@ "dbus-org.freedesktop.ModemManager1".enable = lib.mkForce false; }; - systemd.sleep.extraConfig = '' - HibernateDelaySec=1h - ''; - systemd.tmpfiles.rules = [ "v /var/.snapshots 0755 root root - -" "v /var/paperless/.snapshots 0755 root root - -" From 712cca59093ec0c103e2573560b141a4dec94923 Mon Sep 17 00:00:00 2001 From: Tim Schubert Date: Sun, 27 Jul 2025 01:23:13 +0200 Subject: [PATCH 5/5] feat(stolas): use larger swapfile --- nixos/stolas/default.nix | 3 ++- nixos/stolas/disks.nix | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/nixos/stolas/default.nix b/nixos/stolas/default.nix index 9c3ed83..9ae2d23 100644 --- a/nixos/stolas/default.nix +++ b/nixos/stolas/default.nix @@ -26,7 +26,8 @@ # Hopefully fixes suspend issues with wifi card kernelPackages = pkgs.linuxPackages_latest; kernelParams = [ - "resume_offset=533760" + "resume=UUID=81dfbfa5-d578-479c-b11c-3ee5abd6848a" + "resume_offset=79859524" "zswap.enabled=1" ]; extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ]; diff --git a/nixos/stolas/disks.nix b/nixos/stolas/disks.nix index 01cf635..eff5680 100644 --- a/nixos/stolas/disks.nix +++ b/nixos/stolas/disks.nix @@ -86,7 +86,7 @@ }; "/swap" = { mountpoint = "/.swapvol"; - swap.swapfile.size = "64G"; + swap.swapfile.size = "128G"; }; }; };