Get Surface touchscreen and pen working again.

This commit is contained in:
Kevin Baensch 2019-06-22 20:48:16 +02:00
parent df94c03ca5
commit 8eccb1aca2
2 changed files with 35 additions and 10 deletions

View file

@ -1,7 +1,28 @@
{ pkgs, ... }:
let
musnix_channel = (fetchTarball "https://github.com/musnix/musnix/archive/master.tar.gz");
musnix_channel = (fetchTarball "https://github.com/musnix/musnix/archive/master.tar.gz");
version = "5.0.10";
patchlevel = "1";
linux-surface = pkgs.fetchFromGitHub {
owner = "jakeday";
repo = "linux-surface";
rev = "${version}-${patchlevel}";
sha256 = "1q8dv7j6gwgszqavb35aswwfn7c7mwkc2xqd2v8gvxnjk7sp4747";
};
buildFirmware = (name: subdir: src: pkgs.stdenvNoCC.mkDerivation {
name = "${name}-firmware";
src = src;
nativeBuildInputs = [ pkgs.unzip ];
sourceRoot = ".";
installPhase = ''
mkdir -p $out/lib/firmware/${subdir}
cp -r * $out/lib/firmware/${subdir}
'';
});
i915-firmware = buildFirmware "i915" "i915" "${linux-surface}/firmware/i915_firmware_skl.zip";
# vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
in {
imports = [ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
@ -12,23 +33,28 @@ in {
alsaSeq.enable = true;
ffado.enable = true;
soundcardPciId = "00:14.0";
kernel.realtime = true;
kernel.packages = pkgs.linuxPackages_4_19_rt;
rtirq.enable = true;
kernel.realtime = false;
# kernel.packages = pkgs.linuxPackages_4_19_rt;
rtirq.enable = false;
};
boot = {
loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true;
cleanTmpDir = true;
# kernelPackages = pkgs.linuxPackages_4_19;
kernelPackages = pkgs.linuxPackages_surface; # 4_19 worked
initrd.kernelModules = [ "hid-multitouch" ];
initrd.availableKernelModules = [ "hid-microsoft" "hid-multitouch" "xhci_pci" "nvme" "usb_storage" "sd_mod" ];
kernelModules = [ "kvm-intel" "hid-microsoft" "hid-multitouch" "uinput" ];
kernel.sysctl = { "fs.inotify.max_user_watches" = 524288; };
initrd.availableKernelModules = [ "hid" "surface_acpi" "hid-microsoft" "hid-multitouch" "xhci_pci" "nvme" "usb_storage" "sd_mod" ];
kernelModules = [ "intel_ipts" "kvm-intel" "hid-microsoft" "hid-multitouch" "uinput" ];
kernel.sysctl = {
"kernel.nmi_watchdog" = 0;
"fs.inotify.max_user_watches" = 524288;
"vm.dirty_writeback_centisecs" = 1500;
};
kernelParams = [ "threadirq" ];
extraModulePackages = [ ];
extraModprobeConfig = "options snd_hda_intel power_save=1 power_save_controller=Y";
};
fileSystems."/" =
@ -45,7 +71,7 @@ in {
swapDevices = [ ];
hardware = {
firmware = with pkgs; [ firmwareLinuxNonfree firmware_surface ];
firmware = with pkgs; [ firmwareLinuxNonfree i915-firmware firmware_surface ];
cpu.intel.updateMicrocode = true;
enableAllFirmware = true;
enableKSM = true;

View file

@ -32,7 +32,6 @@ with lib;
services = [
"containers"
"desktop"
"docker"
"udev"
"cups"
];