Add hibernation to foxtrot

This commit is contained in:
Daniel Flanagan 2023-11-21 10:36:19 -06:00
parent 1675f40ec3
commit 6760c5ba9e
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4
2 changed files with 43 additions and 2 deletions

View file

@ -1,4 +1,4 @@
{...}: {
{colors, ...}: {
programs.broot = {
enable = true;
enableFishIntegration = true;
@ -12,6 +12,23 @@
execution = "$EDITOR {file}";
}
];
skin = with colors.withHashPrefix; {
status_normal_fg = fg;
status_normal_bg = bg;
status_error_fg = red;
status_error_bg = yellow;
tree_fg = red;
selected_line_bg = bg2;
permissions_fg = purple;
size_bar_full_bg = red;
size_bar_void_bg = bg;
directory_fg = yellow;
input_fg = blue;
flag_value_fg = yellow;
table_border_fg = red;
code_fg = yellow;
};
};
};
}

View file

@ -24,7 +24,26 @@
inputs.hardware.nixosModules.framework-13-7040-amd
];
# TODO: hibernation? does sleep suffice?
swapDevices = [
# TODO: move this to disko?
# sudo btrfs subvolume create /swap
# sudo btrfs filesystem mkswapfile --size 32g --uuid clear /swap/swapfile
# sudo swapon /swap/swapfile
{device = "/swap/swapfile";}
];
# findmnt -no UUID -T /swap/swapfile
boot.resumeDevice = "/dev/disk/by-uuid/3076912c-ac61-4067-b6b2-361f68b2d038";
services.logind = {
lidSwitch = "suspend-then-hibernate";
extraConfig = ''
HandlePowerKey=suspend-then-hibernate
IdleAction=suspend-then-hibernate
IdleActionSec=1m
'';
};
systemd.sleep.extraConfig = "HibernateDelaySec=30m";
services.fwupd.enable = true;
services.fwupd.extraRemotes = ["lvfs-testing"];
@ -45,10 +64,15 @@
systemd-boot.enable = true;
};
kernelPackages = pkgs.linuxPackages_6_5;
# sudo filefrag -v /swap/swapfile | awk '$1=="0:" {print substr($4, 1, length($4)-2)}'
# the above won't work for btrfs, instead you need
# btrfs inspect-internal map-swapfile -r /swap/swapfile
# https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Hibernation_into_swap_file
# many of these come from https://wiki.archlinux.org/title/Framework_Laptop_13#Suspend
kernelParams = [
"amdgpu.sg_display=0"
"acpi_osi=\"!Windows 2020\""
"resume_offset=39331072"
# "nvme.noacpi=1" # maybe causing crashes upon waking?
# "rtc_cmos.use_acpi_alarm=1" # maybe causing excessive battery drain while sleeping -- perhaps due to waking?
];