lenovo-p1.nix (1595B)
1 { config, pkgs, lib, ... }: 2 #let 3 # sources = import ../../nix/sources.nix; 4 #in 5 { 6 imports = [ 7 # (sources.nixos-hardware + "/common/pc/ssd") 8 # (sources.nixos-hardware + "/lenovo/thinkpad/p1/3th-gen") 9 ./thinkpad.nix 10 ]; 11 boot = { 12 initrd.availableKernelModules = [ "nvme" "rtsx_pci_sdmmc" "thunderbolt" "dm-mod" ]; 13 }; 14 hardware = { 15 enableAllFirmware = true; 16 bluetooth = { 17 enable = true; 18 powerOnBoot = true; 19 }; 20 }; 21 nix.maxJobs = 12; 22 services.throttled.enable = lib.mkDefault true; 23 services = { 24 tlp = { 25 settings = { 26 # CPU optimizations 27 "CPU_SCALING_GOVERNOR_ON_AC" = "performance"; 28 "CPU_SCALING_GOVERNOR_ON_BAT" = "powersave"; 29 "CPU_MIN_PERF_ON_AC" = 0; 30 "CPU_MAX_PERF_ON_AC" = 100; 31 "CPU_MIN_PERF_ON_BAT" = 0; 32 "CPU_MAX_PERF_ON_BAT" = 50; 33 # DEVICES (wifi, ..) 34 "DEVICES_TO_DISABLE_ON_STARTUP" = ""; 35 "DEVICES_TO_ENABLE_ON_AC" = "bluetooth wifi wwan"; 36 "DEVICES_TO_DISABLE_ON_BAT" = ""; 37 # Network management 38 "DEVICES_TO_DISABLE_ON_LAN_CONNECT" = ""; 39 "DEVICES_TO_DISABLE_ON_WIFI_CONNECT" = ""; 40 "DEVICES_TO_DISABLE_ON_WWAN_CONNECT" = ""; 41 "DEVICES_TO_ENABLE_ON_LAN_DISCONNECT" = ""; 42 "DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT" = ""; 43 "DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT" = ""; 44 # Docking 45 "DEVICES_TO_DISABLE_ON_DOCK" = "wifi"; 46 "DEVICES_TO_ENABLE_ON_UNDOCK" = "wifi"; 47 # Make sure it uses the right hard drive 48 "DISK_DEVICES" = "nvme0n1p2"; 49 }; 50 }; 51 }; 52 }