Make resumeDevice optional

This commit is contained in:
Hendrik Sokolowski 2022-11-02 20:55:05 +01:00
parent 1c6a726d01
commit 25126fd8ca
Signed by untrusted user: hensoko
GPG key ID: 5C36A01B80BCCC59

View file

@ -15,8 +15,8 @@ in {
};
resumeDevice = mkOption {
type = types.str;
default = "/dev/sda1";
type = types.nullOr types.str;
default = null;
description = "The location of the hibernation resume swap file.";
};
@ -29,7 +29,7 @@ in {
config = {
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}"];
};
};