From 9134370c2359cb815b22f8733fc99d54962ee73a Mon Sep 17 00:00:00 2001 From: Luis Guilherme Coelho Date: Tue, 19 Nov 2024 11:51:37 -0300 Subject: [PATCH] operating-systems: buer: Add /swap/swapfile for eventual long hibernations --- operating-systems/buer.scm | 11 +++++++++-- operating-systems/buer/file-systems.scm | 11 +++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/operating-systems/buer.scm b/operating-systems/buer.scm index 32dfe49..d085235 100644 --- a/operating-systems/buer.scm +++ b/operating-systems/buer.scm @@ -121,7 +121,8 @@ (kernel linux-libre-6.11) (kernel-arguments - (cons* "modprobe.blacklist=usbmouse,usbkbd,pcspkr" + (cons* "resume=/swap/swapfile" + "modprobe.blacklist=usbmouse,usbkbd,pcspkr" "thinkpad_acpi.fan_control=1" (filter (negate ((on disjoin (partial partial string-prefix?)) @@ -131,7 +132,12 @@ (file-systems (append file-system:volumes file-system:persistent-directories)) - + (swap-devices + (list (swap-space + (target "/swap/swapfile") + (dependencies + (filter (file-system-mount-point-predicate "/swap") + file-systems))))) (users (cons* user:radio user:root @@ -277,6 +283,7 @@ #|Memory management services|# (service zram-device-service-type (zram-device-configuration + (priority 100) (size (* 2 (ram-total))) (compression-algorithm 'lz4))) diff --git a/operating-systems/buer/file-systems.scm b/operating-systems/buer/file-systems.scm index db381c4..22daafb 100644 --- a/operating-systems/buer/file-systems.scm +++ b/operating-systems/buer/file-systems.scm @@ -112,6 +112,17 @@ (needed-for-boot? #t) (options "mode=0755")) + #|swap|# + (file-system + (device partition:guix) + (type "btrfs") + (mount-point "/swap") + (check? #f) + (needed-for-boot? #t) + (options (format #f "subvol=@swap,~ + discard=async,~ + ssd"))) + #|home|# (file-system (device partition:guix)