2024-07-26 23:07:07 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
...
|
|
|
|
}: let
|
2024-06-24 23:38:05 +00:00
|
|
|
inherit (lib) mkIf;
|
|
|
|
deviceType = config.myOptions.device.roles.type;
|
|
|
|
acceptedTypes = ["laptop" "desktop"];
|
|
|
|
in {
|
|
|
|
config = mkIf (builtins.elem deviceType acceptedTypes) {
|
|
|
|
# despite being under logind, this has nothing to do with login
|
|
|
|
# it's about power management
|
|
|
|
services.logind = {
|
2024-09-13 19:18:43 +00:00
|
|
|
lidSwitch = "suspend";
|
2024-08-09 19:31:19 +00:00
|
|
|
lidSwitchExternalPower = "suspend";
|
2024-06-24 23:38:05 +00:00
|
|
|
extraConfig = ''
|
2024-09-13 19:18:43 +00:00
|
|
|
HandlePowerKey=suspend
|
2024-06-24 23:38:05 +00:00
|
|
|
HibernateDelaySec=3600
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|