Set kernel parameters to allow for hibernation
This commit is contained in:
parent
1d622b7000
commit
96dc68a349
@ -2,6 +2,7 @@ inputs:
|
|||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
hostname = "morpheus";
|
hostname = "morpheus";
|
||||||
|
swapUUID = "93bdadfc-961a-4ea6-aef0-d3cd50847f0b";
|
||||||
in
|
in
|
||||||
inputs.nixpkgs.lib.nixosSystem {
|
inputs.nixpkgs.lib.nixosSystem {
|
||||||
inherit system;
|
inherit system;
|
||||||
@ -71,6 +72,13 @@ inputs.nixpkgs.lib.nixosSystem {
|
|||||||
kernelModules = [ "kvm-amd" ];
|
kernelModules = [ "kvm-amd" ];
|
||||||
# use latest kernel
|
# use latest kernel
|
||||||
kernelPackages = pkgs.linuxPackages_latest;
|
kernelPackages = pkgs.linuxPackages_latest;
|
||||||
|
kernelParams = [
|
||||||
|
/* enable hibernation with swapfile */
|
||||||
|
/* https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Hibernation_into_swap_file */
|
||||||
|
("resume=UUID=" + swapUUID)
|
||||||
|
/* sudo filefrag -v /swap/swapfile | awk '$1=="0:" {print substr($4, 1, length($4)-2)}' */
|
||||||
|
"resume_offset=269568"
|
||||||
|
];
|
||||||
kernel.sysctl = {
|
kernel.sysctl = {
|
||||||
# function keys on keychron keyboard won't work otherwise
|
# function keys on keychron keyboard won't work otherwise
|
||||||
"module.hid_apple.parameters.fnmode" = "2";
|
"module.hid_apple.parameters.fnmode" = "2";
|
||||||
@ -113,7 +121,7 @@ inputs.nixpkgs.lib.nixosSystem {
|
|||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/swap" =
|
fileSystems."/swap" =
|
||||||
{ device = "/dev/disk/by-uuid/93bdadfc-961a-4ea6-aef0-d3cd50847f0b";
|
{ device = "/dev/disk/by-uuid/" + swapUUID;
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = [ "subvol=swap" "noatime" ];
|
options = [ "subvol=swap" "noatime" ];
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user