mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 17:17:22 +01:00
24 lines
661 B
Nix
24 lines
661 B
Nix
{ lib, config, ... }:
|
|
{
|
|
options.swarselsystems = {
|
|
modules.optional.hibernation = lib.mkEnableOption "optional amd gpu settings";
|
|
hibernation = {
|
|
offset = lib.mkOption {
|
|
type = lib.types.int;
|
|
default = 0;
|
|
};
|
|
resumeDevice = lib.mkOption {
|
|
type = lib.types.str;
|
|
default = "/dev/disk/by-label/nixos";
|
|
};
|
|
};
|
|
};
|
|
config = lib.mkIf config.swarselsystems.modules.optional.hibernation {
|
|
boot = {
|
|
kernelParams = [
|
|
"resume_offset=${builtins.toString config.swarselsystems.hibernation.offset}"
|
|
];
|
|
inherit (config.swarselsystems.hibernation) resumeDevice;
|
|
};
|
|
};
|
|
}
|