diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-06-08 21:06:14 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-06-10 16:18:26 +0530 |
| commit | 6fa61afb16715aabef42fdad1ef5633563e6519c (patch) | |
| tree | 839fd9672123504176c66a3868abad6ca5352699 | |
| parent | 38ccadbc876ab9ae4f27d3e84a31f57bee10af3b (diff) | |
| download | homeserver-nixos-config-6fa61afb16715aabef42fdad1ef5633563e6519c.tar.gz homeserver-nixos-config-6fa61afb16715aabef42fdad1ef5633563e6519c.zip | |
Laptop lid states
Diffstat (limited to '')
| -rwxr-xr-x | build.sh | 2 | ||||
| -rw-r--r-- | configuration.nix | 10 | ||||
| -rw-r--r-- | modules/hardware.nix | 22 |
3 files changed, 18 insertions, 16 deletions
@@ -9,7 +9,7 @@ config_sync() { # ssh "$SSH_TARGET" sh -c "nixos-rebuild build --flake 'path:/home/bacchus/nixos#bacchus'" } -run_ssh() { ssh "$SSH_TARGET" "$@"; } +run_ssh() { ssh -t "$SSH_TARGET" "$@"; } cmd="$1"; shift; case "$cmd" in diff --git a/configuration.nix b/configuration.nix index 65b4910..9d1b067 100644 --- a/configuration.nix +++ b/configuration.nix @@ -32,16 +32,6 @@ time.timeZone = "Asia/Kolkata"; i18n.defaultLocale = "en_GB.UTF-8"; - # services.logind = { - # powerKey = "ignore"; - # rebootKey = "ignore"; - # lidSwitch = "ignore"; - # lidSwitchDocked = "ignore"; - # lidSwitchExternalPower = "ignore"; - # hibernateKey = "ignore"; - # suspendKey = "ignore"; - # }; - nix.settings = { experimental-features = [ "nix-command" "flakes" ]; auto-optimise-store = true; 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"; - }; } |
