From 4380aae8c1d8ae13cf929311b0af157003881b50 Mon Sep 17 00:00:00 2001 From: coolneng Date: Thu, 19 Jan 2023 12:53:03 +0100 Subject: [PATCH] Move content of the device module into power --- configuration.nix | 1 - modules/device.nix | 32 -------------------------------- modules/power.nix | 29 +++++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 33 deletions(-) delete mode 100644 modules/device.nix diff --git a/configuration.nix b/configuration.nix index 2a3fac5..0421229 100644 --- a/configuration.nix +++ b/configuration.nix @@ -170,7 +170,6 @@ with pkgs; ./modules/periodic.nix ./modules/power.nix ./modules/monitoring.nix - ./modules/device.nix ./overlays/nix-direnv.nix ./overlays/openconnect-sso.nix ./overlays/cyrus-sasl-oauth2.nix diff --git a/modules/device.nix b/modules/device.nix deleted file mode 100644 index 0037cc7..0000000 --- a/modules/device.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ config, lib, pkgs, ... }: - -with pkgs; - -{ - # HACK Enable internal microphone when headphones are plugged in and add workaround for frequent WiFi disconnects - hardware.firmware = [ - (writeTextDir "/lib/firmware/hda-jack-retask.fw" '' - [codec] - 0x10ec0293 0x17aa2233 0 - - [pincfg] - 0x12 0x90a60130 - 0x13 0x40000000 - 0x14 0x90170110 - 0x15 0x03211040 - 0x16 0x21211010 - 0x18 0x411111f0 - 0x19 0x21a11010 - 0x1a 0x40f000f0 - 0x1b 0x411111f0 - 0x1d 0x40738105 - 0x1e 0x411111f0 - '') - ]; - boot.extraModprobeConfig = '' - options snd-hda-intel patch=hda-jack-retask.fw power_save=1 - options mac80211 beacon_loss_count=500 - options iwlwifi power_save=1 - ''; - -} diff --git a/modules/power.nix b/modules/power.nix index 2099969..d247375 100644 --- a/modules/power.nix +++ b/modules/power.nix @@ -35,4 +35,33 @@ # Turn off keyboard backlight when unused services.tp-auto-kbbl.enable = true; + # HACK Enable internal microphone when headphones are plugged in and add workaround for frequent WiFi disconnects + hardware.firmware = [ + (pkgs.writeTextDir "/lib/firmware/hda-jack-retask.fw" '' + [codec] + 0x10ec0293 0x17aa2233 0 + + [pincfg] + 0x12 0x90a60130 + 0x13 0x40000000 + 0x14 0x90170110 + 0x15 0x03211040 + 0x16 0x21211010 + 0x18 0x411111f0 + 0x19 0x21a11010 + 0x1a 0x40f000f0 + 0x1b 0x411111f0 + 0x1d 0x40738105 + 0x1e 0x411111f0 + '') + ]; + + # Power saving features for multiple devices + boot.extraModprobeConfig = '' + options snd-hda-intel patch=hda-jack-retask.fw power_save=1 + options mac80211 beacon_loss_count=500 + options iwlwifi power_save=1 uapsd_disable=0 + options iwlmvm power_scheme=3 + ''; + }