From af1996f65265e1455eae54854ba7c2ce9027dd81 Mon Sep 17 00:00:00 2001 From: denten Date: Fri, 29 Jun 2018 03:22:34 -0400 Subject: [PATCH] first stab at x1 gen6 profile --- lenovo/thinkpad/default.nix | 41 ++++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/lenovo/thinkpad/default.nix b/lenovo/thinkpad/default.nix index ff22639..7ef5e5e 100644 --- a/lenovo/thinkpad/default.nix +++ b/lenovo/thinkpad/default.nix @@ -1,10 +1,41 @@ -{ lib, pkgs, ... }: +# pulled out all the x1 specific things +# for nixos-hardware + +{ config, pkgs, ... }: { - imports = [ ../../common/pc/laptop ]; - hardware.trackpoint.enable = lib.mkDefault true; + boot.kernelModules = [ "acpi" "thinkpad-acpi" "acpi-call" ]; + boot.extraModulePackages = [ config.boot.kernelPackages.acpi_call ]; + boot.extraModprobeConfig = "options thinkpad_acpi experimental=1 fan_control=1"; - # Fingerprint reader: login and unlock with fingerprint (if you add one with `fprintd-enroll`) - # services.fprintd.enable = true; + environment.systemPackages = with pkgs; [ + tlp + ]; + + # enable thermal trottle + services.thermald.enable = true; + + # enable sound + sound.enable = true; + hardware.pulseaudio.enable = true; + + # handle lid close hibernate, suspend, or ignore + systemd.extraConfig = ""; + services.logind.extraConfig = '' + HandleLidSwitch=hibernate + LidSwitchIgnoreInhibited=yes + ''; + + # Thinkpad power services with some sample values + services.tlp.enable = true; + services.tlp.extraConfig = '' + DEVICES_TO_DISABLE_ON_STARTUP="bluetooth" + START_CHARGE_THRESH_BAT0=75 + STOP_CHARGE_THRESH_BAT0=90 + START_CHARGE_THRESH_BAT1=75 + STOP_CHARGE_THRESH_BAT1=90 + CPU_SCALING_GOVERNOR_ON_BAT=powersave + ENERGY_PERF_POLICY_ON_BAT=powersave + ''; }