Make resumeDevice optional

This commit is contained in:
Hendrik Sokolowski 2022-11-02 20:55:05 +01:00
parent aa4af55cb9
commit 6a19820841

View file

@ -12,8 +12,8 @@ in
}; };
resumeDevice = mkOption { resumeDevice = mkOption {
type = types.str; type = types.nullOr types.str;
default = "/dev/sda1"; default = null;
description = "The location of the hibernation resume swap file."; description = "The location of the hibernation resume swap file.";
}; };
@ -26,7 +26,7 @@ in
config = { config = {
boot = mkIf cfg.enable { boot = mkIf cfg.enable {
resumeDevice = cfg.resumeDevice; resumeDevice = mkIf (cfg.resumeDevice != null) cfg.resumeDevice;
kernelParams = mkIf (cfg.resumeOffset != null) [ "resume_offset=${builtins.toString cfg.resumeOffset}" ]; kernelParams = mkIf (cfg.resumeOffset != null) [ "resume_offset=${builtins.toString cfg.resumeOffset}" ];
}; };
}; };