From 123b0a9846b837278f7cd7821fb38fa2f0662e53 Mon Sep 17 00:00:00 2001 From: Damien Cassou Date: Sat, 9 Jul 2016 11:36:19 +0200 Subject: [PATCH 1/4] lenovo/t460s.nix (#13) --- lenovo/t460s.nix | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 lenovo/t460s.nix diff --git a/lenovo/t460s.nix b/lenovo/t460s.nix new file mode 100644 index 000000000000..ee0f9ba6163b --- /dev/null +++ b/lenovo/t460s.nix @@ -0,0 +1,30 @@ +{ config, pkgs, ... }: + +{ + imports = + [ ../lib/kernel-version.nix + ]; + + ## BEGIN from generated hardware-configuration + ## Probably better to just use a freshly generated hardware.configuration.nix + ## than this, but including for reference. + # boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; + # boot.kernelModules = [ "kvm-intel" ]; + # boot.extraModulePackages = [ ]; + # + # + # nix.maxJobs = lib.mkDefault 4; + ## END from generated hardware-configuration + + # Use the gummiboot efi boot loader. (From default generated configuration.nix) + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + # https://wiki.archlinux.org/index.php/Lenovo_ThinkPad_T460s + kernelAtleast = [ + { version = "4.5.1"; msg = "The physical mouse buttons works incorrectly."; } + { version = "4.6"; msg = "Suspending the T460s by closing the lid when running on battery causes the machine to freeze up entirely."; } + ]; + + hardware.enableAllFirmware = true; +} From 5b3c112a91e92d5e030915447000e4d9facea018 Mon Sep 17 00:00:00 2001 From: Damien Cassou Date: Fri, 5 Aug 2016 11:47:24 +0200 Subject: [PATCH 2/4] lenovo/t460s: add middle button config + comments (#14) --- lenovo/t460s.nix | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/lenovo/t460s.nix b/lenovo/t460s.nix index ee0f9ba6163b..4aaed1445e36 100644 --- a/lenovo/t460s.nix +++ b/lenovo/t460s.nix @@ -26,5 +26,34 @@ { version = "4.6"; msg = "Suspending the T460s by closing the lid when running on battery causes the machine to freeze up entirely."; } ]; + # For the wifi (intel iwlwifi) hardware.enableAllFirmware = true; + + # For the screen. I don't know what to do with this information, but + # the hiDPI support is far from perfect (as of July 2016): + + # Resolution: 2560 x 1440 px + # Size: 12.2" × 6.86" (30.99cm × 17.43cm) + # DPI: 209.8 + # Dot Pitch: 0.1211mm + # Aspect Ratio: 16 × 9 (1.78:1) + # Pixel Count: 3,686,400 + # Megapixels: 3.69MP + + # Use libinput to let the physical middle button be used to scroll + # with the trackpoint + services.xserver = { + libinput.enable = true; + synaptics.enable = false; + + config = '' + Section "InputClass" + Identifier "Enable libinput for TrackPoint" + MatchIsPointer "on" + Driver "libinput" + Option "ScrollMethod" "button" + Option "ScrollButton" "8" + EndSection + ''; + }; } From bc241aeec7bb78ad7b6362c8324f194a5696e64b Mon Sep 17 00:00:00 2001 From: Stephen Whitmore Date: Fri, 5 Aug 2016 02:48:33 -0700 Subject: [PATCH 3/4] Add Lenovo x140e laptop. (#17) --- lenovo/x140e.nix | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 lenovo/x140e.nix diff --git a/lenovo/x140e.nix b/lenovo/x140e.nix new file mode 100644 index 000000000000..f825f44f1970 --- /dev/null +++ b/lenovo/x140e.nix @@ -0,0 +1,26 @@ +{ config, lib, pkgs, ... }: + +{ + boot = { + # wireless + kernelModules = [ "kvm-amd" "wl" ]; + extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ]; + + # audio device + extraModprobeConfig = '' + options snd_hda_intel enable=0,1 + ''; + }; + + # video card + services.xserver.videoDrivers = ["ati"]; + + # trackpad (touchpad disabled) + hardware.trackpoint = { + enable = true; + emulateWheel = true; + }; + + # media keys + sound.enableMediaKeys = true; +} From cfd63d3b3e15fd440701dbbd25d57effe379b87d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D0=BB=D0=BE=20=D0=93=D0=BB=D0=B8?= =?UTF-8?q?=D0=BD=D1=81=D1=8C=D0=BA=D0=B8=D0=B9=20=28Danylo=20Hlynskyi=29?= Date: Wed, 21 Sep 2016 12:33:54 +0300 Subject: [PATCH 4/4] add Lenovo IdeaPad Z510 with suspend fix (#18) --- lenovo/z510.nix | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 lenovo/z510.nix diff --git a/lenovo/z510.nix b/lenovo/z510.nix new file mode 100644 index 000000000000..f1f5416b5be6 --- /dev/null +++ b/lenovo/z510.nix @@ -0,0 +1,8 @@ +{ config, pkgs, ... }: +{ + hardware.cpu.intel.updateMicrocode = true; + + # see https://github.com/NixOS/nixpkgs/issues/18356 + # found buggy driver with method https://wiki.ubuntu.com/DebuggingKernelSuspend + boot.blacklistedKernelModules = [ "nouveau" ]; +}