operating-systems: buer: Add /swap/swapfile for eventual long hibernations

main
Luis Guilherme Coelho 2024-11-19 11:51:37 -03:00
parent 92aa147de0
commit 9134370c23
No known key found for this signature in database
GPG Key ID: 1F2E76ACE3F531C8
2 changed files with 20 additions and 2 deletions

View File

@ -121,7 +121,8 @@
(kernel linux-libre-6.11) (kernel linux-libre-6.11)
(kernel-arguments (kernel-arguments
(cons* "modprobe.blacklist=usbmouse,usbkbd,pcspkr" (cons* "resume=/swap/swapfile"
"modprobe.blacklist=usbmouse,usbkbd,pcspkr"
"thinkpad_acpi.fan_control=1" "thinkpad_acpi.fan_control=1"
(filter (negate ((on disjoin (filter (negate ((on disjoin
(partial partial string-prefix?)) (partial partial string-prefix?))
@ -131,7 +132,12 @@
(file-systems (file-systems
(append file-system:volumes (append file-system:volumes
file-system:persistent-directories)) file-system:persistent-directories))
(swap-devices
(list (swap-space
(target "/swap/swapfile")
(dependencies
(filter (file-system-mount-point-predicate "/swap")
file-systems)))))
(users (users
(cons* user:radio (cons* user:radio
user:root user:root
@ -277,6 +283,7 @@
#|Memory management services|# #|Memory management services|#
(service zram-device-service-type (service zram-device-service-type
(zram-device-configuration (zram-device-configuration
(priority 100)
(size (* 2 (ram-total))) (size (* 2 (ram-total)))
(compression-algorithm 'lz4))) (compression-algorithm 'lz4)))

View File

@ -112,6 +112,17 @@
(needed-for-boot? #t) (needed-for-boot? #t)
(options "mode=0755")) (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|# #|home|#
(file-system (file-system
(device partition:guix) (device partition:guix)