mirror of
https://github.com/kittywitch/nixfiles.git
synced 2026-02-09 12:29:19 -08:00
feat(misc): laptop fixes
This commit is contained in:
parent
7f69011deb
commit
8872b78a07
9 changed files with 104 additions and 58 deletions
|
|
@ -5,6 +5,9 @@
|
|||
twitter-color-emoji
|
||||
iosevka-bin
|
||||
monaspace
|
||||
corefonts
|
||||
vistafonts
|
||||
open-dyslexic
|
||||
];
|
||||
enableDefaultPackages = true;
|
||||
fontDir.enable = true;
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue