Merge pull request 'Improve hibernation logic' (#148) from feature/improve-hibernation-logic into main

Reviewed-on: https://git.b12f.io/pub-solar/os/pulls/148
Reviewed-by: Benjamin Bädorf <hello@benjaminbaedorf.eu>
This commit is contained in:
Benjamin Bädorf 2022-10-24 19:35:28 +00:00
commit 6824cf70f3
No known key found for this signature in database
GPG key ID: 5FEAFA6A0FC8075D

View file

@ -27,9 +27,7 @@ in
config = { config = {
boot = mkIf cfg.enable { boot = mkIf cfg.enable {
resumeDevice = cfg.resumeDevice; resumeDevice = cfg.resumeDevice;
kernelParams = kernelParams = mkIf (cfg.resumeOffset != null) [ "resume_offset=${builtins.toString cfg.resumeOffset}" ];
if (cfg.resumeOffset == null && cfg.enable) then builtins.abort "config.pub-solar.resumeOffset has to be set if config.pub-solar.enable is true."
else [ "resume_offset=${builtins.toString cfg.resumeOffset}" ];
}; };
}; };
} }