home

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

thinkpad-x220.nix (1973B)


      1 { config, pkgs, ... }:
      2 #let
      3 #  sources = import ../../nix/sources.nix;
      4 #in
      5 {
      6   imports = [
      7     ./thinkpad.nix
      8     #(sources.nixos-hardware + "/lenovo/thinkpad/tp-smapi.nix")
      9     #(sources.nixos-hardware + "/common/cpu/intel")
     10     #(sources.nixos-hardware + "/common/pc/ssd")
     11   ];
     12   boot = {
     13     kernelParams = [ "i915.enable_psr=1" ];
     14     extraModprobeConfig = ''
     15       options iwlwifi 11n_disable=1
     16     '';
     17   };
     18   nix.maxJobs = 8;
     19   security = {
     20     pam.services = {
     21       slimlock.fprintAuth = false;
     22       slim.fprintAuth = false;
     23       login.fprintAuth = false;
     24       xscreensaver.fprintAuth = false;
     25     };
     26   };
     27   services = {
     28     fprintd.enable = true;
     29     tlp = {
     30       settings = {
     31         # CPU optimizations
     32         "CPU_SCALING_GOVERNOR_ON_AC" = "performance";
     33         "CPU_SCALING_GOVERNOR_ON_BAT" = "powersave";
     34         "CPU_MIN_PERF_ON_AC" = 0;
     35         "CPU_MAX_PERF_ON_AC" = 100;
     36         "CPU_MIN_PERF_ON_BAT" = 0;
     37         "CPU_MAX_PERF_ON_BAT" = 50;
     38         "CPU_BOOST_ON_AC" = 1;
     39         "CPU_BOOST_ON_BAT" = 0;
     40         # DEVICES (wifi, ..)
     41         "DEVICES_TO_DISABLE_ON_STARTUP" = "bluetooth";
     42         "DEVICES_TO_ENABLE_ON_AC" = "bluetooth wifi wwan";
     43         "DEVICES_TO_DISABLE_ON_BAT" = "bluetooth";
     44         # Network management
     45         "DEVICES_TO_DISABLE_ON_LAN_CONNECT" = "";
     46         "DEVICES_TO_DISABLE_ON_WIFI_CONNECT" = "";
     47         "DEVICES_TO_DISABLE_ON_WWAN_CONNECT" = "";
     48         "DEVICES_TO_ENABLE_ON_LAN_DISCONNECT" = "";
     49         "DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT" = "";
     50         "DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT" = "";
     51         # Misc
     52         "DISK_IDLE_SECS_ON_AC" = 0;
     53         "DISK_IDLE_SECS_ON_BAT" = 2;
     54         "MAX_LOST_WORK_SECS_ON_AC" = 15;
     55         "MAX_LOST_WORK_SECS_ON_BAT" = 60;
     56         "DISK_DEVICES" = "ata-Corsair_Force_LX_SSD_15256501000102160059";
     57         "SOUND_POWER_SAVE_ON_AC" = 0;
     58         "SOUND_POWER_SAVE_ON_BAT" = 1;
     59         "USB_AUTOSUSPEND" = 1;
     60         "USB_BLACKLIST_BTUSB" = 1;
     61       };
     62     };
     63   };
     64 }