1
0

hosts/krypton: Turn on keyboard backlight and display battery levels at cryptsetup askpass

This commit is contained in:
clerie 2024-01-08 15:44:28 +01:00
parent 9284723eae
commit 568d3f8d89
2 changed files with 18 additions and 0 deletions

View File

@ -8,6 +8,7 @@
../../configuration/desktop ../../configuration/desktop
./backup.nix ./backup.nix
./initrd.nix
./network.nix ./network.nix
./programs.nix ./programs.nix
]; ];

17
hosts/krypton/initrd.nix Normal file
View File

@ -0,0 +1,17 @@
{ ... }:
{
boot.initrd.kernelModules = [ "thinkpad_acpi" ];
boot.initrd.preLVMCommands = ''
# Turn on keyboard backlight before asking for drive encryption password
echo 1 > /sys/class/leds/tpacpi::kbd_backlight/brightness
# Show battery levels
echo
echo "Battery level: External $(cat /sys/class/power_supply/BAT1/capacity)% Internal $(cat /sys/class/power_supply/BAT0/capacity)%"
echo
'';
}