aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-06-08 21:06:14 +0530
committerAkshay Nair <phenax5@gmail.com>2025-06-10 16:18:26 +0530
commit6fa61afb16715aabef42fdad1ef5633563e6519c (patch)
tree839fd9672123504176c66a3868abad6ca5352699 /modules
parent38ccadbc876ab9ae4f27d3e84a31f57bee10af3b (diff)
downloadhomeserver-nixos-config-6fa61afb16715aabef42fdad1ef5633563e6519c.tar.gz
homeserver-nixos-config-6fa61afb16715aabef42fdad1ef5633563e6519c.zip
Laptop lid states
Diffstat (limited to 'modules')
-rw-r--r--modules/hardware.nix22
1 files changed, 17 insertions, 5 deletions
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";
- };
}