From 6fa61afb16715aabef42fdad1ef5633563e6519c Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 8 Jun 2025 21:06:14 +0530 Subject: Laptop lid states --- modules/hardware.nix | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'modules') diff --git a/modules/hardware.nix b/modules/hardware.nix index f936109..5a20353 100644 --- a/modules/hardware.nix +++ b/modules/hardware.nix @@ -1,4 +1,4 @@ -{ lib, pkgs, modulesPath, ... }: +{ lib, modulesPath, ... }: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") @@ -18,6 +18,22 @@ }; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + # Power/power state + powerManagement = { + enable = true; + cpuFreqGovernor = "powersave"; + }; + services.acpid.enable = true; + services.logind = { + powerKey = "ignore"; + rebootKey = "ignore"; + lidSwitch = "ignore"; + lidSwitchDocked = "ignore"; + lidSwitchExternalPower = "ignore"; + hibernateKey = "ignore"; + suspendKey = "ignore"; + }; + # Bootloader boot.loader = { systemd-boot = { @@ -47,8 +63,4 @@ swapDevices = [{ device = "/dev/disk/by-label/swap"; }]; networking.useDHCP = lib.mkDefault true; - powerManagement = { - enable = true; - cpuFreqGovernor = "powersave"; - }; } -- cgit v1.3.1