Get Surface touchscreen and pen working again.
This commit is contained in:
parent
df94c03ca5
commit
8eccb1aca2
2 changed files with 35 additions and 10 deletions
|
@ -1,7 +1,28 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
let
|
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; };
|
# vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
|
||||||
in {
|
in {
|
||||||
imports = [ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
|
imports = [ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
|
||||||
|
@ -12,23 +33,28 @@ in {
|
||||||
alsaSeq.enable = true;
|
alsaSeq.enable = true;
|
||||||
ffado.enable = true;
|
ffado.enable = true;
|
||||||
soundcardPciId = "00:14.0";
|
soundcardPciId = "00:14.0";
|
||||||
kernel.realtime = true;
|
kernel.realtime = false;
|
||||||
kernel.packages = pkgs.linuxPackages_4_19_rt;
|
# kernel.packages = pkgs.linuxPackages_4_19_rt;
|
||||||
rtirq.enable = true;
|
rtirq.enable = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
loader.systemd-boot.enable = true;
|
loader.systemd-boot.enable = true;
|
||||||
loader.efi.canTouchEfiVariables = true;
|
loader.efi.canTouchEfiVariables = true;
|
||||||
cleanTmpDir = true;
|
cleanTmpDir = true;
|
||||||
# kernelPackages = pkgs.linuxPackages_4_19;
|
kernelPackages = pkgs.linuxPackages_surface; # 4_19 worked
|
||||||
|
|
||||||
initrd.kernelModules = [ "hid-multitouch" ];
|
initrd.kernelModules = [ "hid-multitouch" ];
|
||||||
initrd.availableKernelModules = [ "hid-microsoft" "hid-multitouch" "xhci_pci" "nvme" "usb_storage" "sd_mod" ];
|
initrd.availableKernelModules = [ "hid" "surface_acpi" "hid-microsoft" "hid-multitouch" "xhci_pci" "nvme" "usb_storage" "sd_mod" ];
|
||||||
kernelModules = [ "kvm-intel" "hid-microsoft" "hid-multitouch" "uinput" ];
|
kernelModules = [ "intel_ipts" "kvm-intel" "hid-microsoft" "hid-multitouch" "uinput" ];
|
||||||
kernel.sysctl = { "fs.inotify.max_user_watches" = 524288; };
|
kernel.sysctl = {
|
||||||
|
"kernel.nmi_watchdog" = 0;
|
||||||
|
"fs.inotify.max_user_watches" = 524288;
|
||||||
|
"vm.dirty_writeback_centisecs" = 1500;
|
||||||
|
};
|
||||||
kernelParams = [ "threadirq" ];
|
kernelParams = [ "threadirq" ];
|
||||||
extraModulePackages = [ ];
|
extraModulePackages = [ ];
|
||||||
|
extraModprobeConfig = "options snd_hda_intel power_save=1 power_save_controller=Y";
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/" =
|
fileSystems."/" =
|
||||||
|
@ -45,7 +71,7 @@ in {
|
||||||
swapDevices = [ ];
|
swapDevices = [ ];
|
||||||
|
|
||||||
hardware = {
|
hardware = {
|
||||||
firmware = with pkgs; [ firmwareLinuxNonfree firmware_surface ];
|
firmware = with pkgs; [ firmwareLinuxNonfree i915-firmware firmware_surface ];
|
||||||
cpu.intel.updateMicrocode = true;
|
cpu.intel.updateMicrocode = true;
|
||||||
enableAllFirmware = true;
|
enableAllFirmware = true;
|
||||||
enableKSM = true;
|
enableKSM = true;
|
||||||
|
|
|
@ -32,7 +32,6 @@ with lib;
|
||||||
services = [
|
services = [
|
||||||
"containers"
|
"containers"
|
||||||
"desktop"
|
"desktop"
|
||||||
"docker"
|
|
||||||
"udev"
|
"udev"
|
||||||
"cups"
|
"cups"
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in a new issue