home

My NixOS systems configurations.
Log | Files | Refs | LICENSE

thinkpad-t480s.nix (1985B)


      1 { config, pkgs, ... }:
      2 #let
      3 #  sources = import ../../nix/sources.nix;
      4 #in
      5 {
      6   imports = [
      7     #(sources.nixos-hardware + "/lenovo/thinkpad/t480s")
      8     #(sources.nixos-hardware + "/common/pc/ssd")
      9     ./thinkpad.nix
     10   ];
     11   boot = {
     12     initrd.availableKernelModules = [ "nvme" "rtsx_pci_sdmmc" "thunderbolt" ];
     13     kernelParams = [ "intel_idle.max_cstate=4" ];
     14   };
     15   hardware = {
     16     enableAllFirmware = true;
     17     bluetooth = {
     18       enable = true;
     19       powerOnBoot = true;
     20     };
     21   };
     22   nix.maxJobs = 12;
     23   programs.light.enable = true;
     24   services = {
     25     throttled.enable = true;
     26     tlp = {
     27       settings = {
     28         # CPU optimizations
     29         "CPU_SCALING_GOVERNOR_ON_AC" = "performance";
     30         "CPU_SCALING_GOVERNOR_ON_BAT" = "powersave";
     31         "CPU_MIN_PERF_ON_AC" = 0;
     32         "CPU_MAX_PERF_ON_AC" = 100;
     33         "CPU_MIN_PERF_ON_BAT" = 0;
     34         "CPU_MAX_PERF_ON_BAT" = 50;
     35         # DEVICES (wifi, ..)
     36         "DEVICES_TO_DISABLE_ON_STARTUP" = "";
     37         "DEVICES_TO_ENABLE_ON_AC" = "bluetooth wifi wwan";
     38         "DEVICES_TO_DISABLE_ON_BAT" = "";
     39         # Network management
     40         "DEVICES_TO_DISABLE_ON_LAN_CONNECT" = "";
     41         "DEVICES_TO_DISABLE_ON_WIFI_CONNECT" = "";
     42         "DEVICES_TO_DISABLE_ON_WWAN_CONNECT" = "";
     43         "DEVICES_TO_ENABLE_ON_LAN_DISCONNECT" = "";
     44         "DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT" = "";
     45         "DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT" = "";
     46         # Docking
     47         "DEVICES_TO_DISABLE_ON_DOCK" = "wifi";
     48         "DEVICES_TO_ENABLE_ON_UNDOCK" = "wifi";
     49         # Make sure it uses the right hard drive
     50         "DISK_DEVICES" = "nvme0n1p3";
     51       };
     52     };
     53     udev.extraRules = ''
     54       # Rules for Lenovo Thinkpad WS Dock
     55       # SUBSYSTEM=="usb", ACTION=="add|remove", ENV{ID_VENDOR}=="17ef", ENV{ID_MODEL}=="305a", RUN+="${pkgs.vde-thinkpad}/bin/dock"
     56       ACTION=="add", SUBSYSTEM=="thunderbolt", ATTR{authorized}=="0", ATTR{authorized}="1"
     57     '';
     58     xserver = {
     59       # dpi = 128;
     60       dpi = 96;
     61     };
     62   };
     63 }