{...}: {
  services.logind = {
    lidSwitch = "suspend-then-hibernate";
    extraConfig = ''
      IdleAction=ignore
      HandlePowerKey=hibernate
      HandlePowerKeyLongPress=poweroff
    '';
  };
}