feat(misc): laptop fixes

This commit is contained in:
Kat Inskip 2024-02-05 19:30:04 -08:00
parent 7f69011deb
commit 8872b78a07
Signed by: kat
GPG key ID: 465E64DECEA8CF0F
9 changed files with 104 additions and 58 deletions

View file

@ -5,6 +5,9 @@
twitter-color-emoji
iosevka-bin
monaspace
corefonts
vistafonts
open-dyslexic
];
enableDefaultPackages = true;
fontDir.enable = true;

View file

@ -1,3 +1,24 @@
_: {
{
pkgs,
lib,
...
}: {
powerManagement.powertop.enable = true;
systemd.services.powertop.serviceConfig.ExecStartPost = let
deviceList = [
"ThinkPad Dock"
"Razer"
"YubiKey"
"Keychron"
];
inherit (lib.strings) concatMapStrings;
deviceCommands =
concatMapStrings (device: ''
for f in $(${pkgs.gnugrep}/bin/grep -Rl "${device}" /sys/bus/usb/devices/*/product); do
${pkgs.coreutils}/bin/echo on > $(dirname $f)/power/control
done
'')
deviceList;
execStartPost = pkgs.writeShellScriptBin "powertop-execStartPost" deviceCommands;
in "${execStartPost}/bin/powertop-execStartPost";
}