2025-09-25 20:44:23 +02:00
{
lib ,
pkgs ,
config ,
username ,
home-manager ,
. . .
} :
2024-10-21 22:57:49 +02:00
with lib ;
let
cfg = config . liv . laptop ;
2025-09-25 20:44:23 +02:00
in
{
2024-10-21 22:57:49 +02:00
options . liv . laptop = {
enable = mkEnableOption " E n a b l e l a p t o p " ;
} ;
config = mkIf cfg . enable {
2025-09-25 20:44:23 +02:00
environment . systemPackages = with pkgs ; [
cifs-utils
powertop
] ;
2024-10-21 22:57:49 +02:00
home-manager = {
users . ${ username } = {
home . packages = with pkgs ; [
acpi
brightnessctl
] ;
} ;
2024-10-21 17:12:46 +02:00
} ;
2025-09-25 20:49:27 +02:00
# DisplayLink
services . xserver . videoDrivers = [
" d i s p l a y l i n k "
" m o d e s e t t i n g "
] ;
systemd . services . dlm . wantedBy = [ " m u l t i - u s e r . t a r g e t " ] ;
2024-10-21 17:12:46 +02:00
networking . networkmanager . enable = true ;
boot = {
2025-09-25 20:44:23 +02:00
kernelModules = [ " a c p i _ c a l l " ] ;
extraModulePackages = with config . boot . kernelPackages ; [
acpi_call
] ;
} ;
services = {
2024-12-20 20:12:00 +01:00
thermald . enable = true ;
2024-10-22 15:00:16 +02:00
power-profiles-daemon . enable = true ;
2025-09-25 20:44:23 +02:00
2024-10-21 22:57:49 +02:00
upower = {
enable = true ;
percentageLow = 20 ;
percentageCritical = 10 ;
percentageAction = 5 ;
criticalPowerAction = " H i b e r n a t e " ;
2024-10-21 17:12:46 +02:00
} ;
} ;
2025-10-03 17:52:35 +02:00
powerManagement . powertop . enable = false ; # somehow figure out how to let this not apply to specific USB devices, as they will auto suspend and that is annoying.
2024-10-21 17:12:46 +02:00
} ;
}