surface: Fix issues

This commit is contained in:
PapaTutuWawa 2021-09-04 20:16:58 +02:00
parent 06ce36a741
commit 944496c2d9
3 changed files with 55 additions and 49 deletions

View File

@ -8,25 +8,31 @@ in mkHost config {
overlays = [ "nur" "unstable" "simple" "custom" ]; overlays = [ "nur" "unstable" "simple" "custom" ];
hardwareImports = [ hardwareImports = [
"intel" "intel"
#"surface-pro6" "wifi"
"mobile"
"surface-pro6"
]; ];
programImports = [ programImports = [
"zsh" "git" "mpv" "tmux" "firefox" "gnome-terminal" "gnome" "i18n" "zsh" "git" "mpv" "tmux" "firefox" "gnome-terminal" "gnome" "i18n"
"distributed-build/offload.nix"
]; ];
fileSystems = { fileSystems = {
"/" = { "/" = {
device = "/dev/nvme0n1p1"; device = "/dev/disk/by-label/root";
fsType = "btrfs"; fsType = "btrfs";
}; };
"/boot" = { "/boot" = {
device = "/dev/nvme0n1p3"; device = "/dev/disk/by-label/boot";
fsType = "vfat"; fsType = "vfat";
} };
}; };
swapDevices = [ swapDevices = [
# TODO {
device = "/dev/disk/by-label/swap";
}
]; ];
extraOptions = old: { extraOptions = old: {
networking.wireless.enable = true;
hardware.video.hidpi.enable = true; hardware.video.hidpi.enable = true;
boot = { boot = {
extraModprobeConfig = '' extraModprobeConfig = ''

View File

@ -5,6 +5,5 @@
# Battery savings # Battery savings
#services.tlp.enable = true; #services.tlp.enable = true;
# TODO: Maybe move this out of here hardware.sensor.iio.enable = true;
environment.systemPackages = [ pkgs.iio-sensor-proxy ];
} }

View File

@ -1,6 +1,7 @@
{ pkgs, fetchpatch, ... }: { pkgs, ... }:
let let
fetchpatch = pkgs.fetchpatch;
commit = "f69eefacf7304857f8c0ce7ac0ebf4971121da72"; commit = "f69eefacf7304857f8c0ce7ac0ebf4971121da72";
mkPatch = name: sha256: { mkPatch = name: sha256: {
name = name; name = name;
@ -11,7 +12,7 @@ let
}; };
}; };
in { in {
etc."ipts.conf".text = '' environment.etc."ipts.conf".text = ''
[Config] [Config]
BlockOnPalm = true BlockOnPalm = true
''; '';
@ -23,7 +24,7 @@ in {
after = [ "dev-ipts-15.device" ]; after = [ "dev-ipts-15.device" ];
serviceConfig = { serviceConfig = {
Type = "simple"; Type = "simple";
ExecStart = "{pkgs.iptsd}/bin/iptsd"; ExecStart = "${pkgs.iptsd}/bin/iptsd";
}; };
}; };
environment.systemPackages = with pkgs; [ iptsd surface-control ]; environment.systemPackages = with pkgs; [ iptsd surface-control ];
@ -32,17 +33,17 @@ in {
boot = { boot = {
kernelPackages = pkgs.linuxPackages_5_13; kernelPackages = pkgs.linuxPackages_5_13;
kernelPatches = [ kernelPatches = [
(mkPatch "0001-surface3-oemb" "0mvyjczylkkrdlqh8h9msl4mb0rzgkdjvnyjg7rg0ig7yiibg5r6") (mkPatch "0001-surface3-oemb" "1h5f4qgrv74x8q02f29xfia9imcm6svh5gv5vb5izxx6w5i6c9fh")
(mkPatch "0002-mwifiex" "088gfc2skaizwz22bjha9a20pbn2isgbczy1khsgf7m4vpfhng39") #(mkPatch "0002-mwifiex" "1qn5lqhbg67j1226msiijq42zdjwmvxzyfd5q366hlczcsw7a7r2")
(mkPatch "0003-ath10k" "d5f388f2b1283d646788436c7b84c83b3bb7278fc5e7fe3b4cd99533763aad08") (mkPatch "0003-ath10k" "0zwyb1vksh6sjbwy5fp2c108m6fqzrv78cz3a296cff550ldn0fj")
(mkPatch "0004-ipts" "94295c2f4658a7b425697d2489ce393fb4281f8da6ce1bfba663ddcd8bb23ef6") (mkPatch "0004-ipts" "0ap5li17zyvba1zx4ryyyk42m00rg5ympj2n24g5ylrld0n2xc3x")
(mkPatch "0005-surface-sam-over-hid" "445da75d34a3e04164c2c20b7744f30a762ca4a9f3c29ad1832c11b8904f6c6b") (mkPatch "0005-surface-sam-over-hid" "1vm4v84zbyiiqwby3cr7n8ffibx072rb7rhrl5hv37dsdr03gsa3")
(mkPatch "0006-surface-sam" "098d84236e0ce65681bd32bab2924560175d71d286e98b9627bc6102100c71f9") (mkPatch "0006-surface-sam" "1fi0w9bnfnwllmypk3llc58dmfsvx34772g8c52dgi4h9wsgnbhj")
(mkPatch "0007-surface-hotplug" "e120b86aa48665099207de3c2fab4cb3384148dd818a9ab5949df2499d5be031") (mkPatch "0007-surface-hotplug" "0g3fkc12pc15aqq6nqk1zfp99lj1wj7cgc1n9691bp8fhqx5aj28")
(mkPatch "0008-surface-typecover" "2a0ad04bbe8661594a6cd3fff2a7a9e6e66243436b1fea8f3dcadef3b7a79fa7") (mkPatch "0008-surface-typecover" "0803nd0w5rv17kwk3y577pm22zwzpcb52ddlkanm7jrbsrhk130f")
(mkPatch "0009-cameras" "8c9d687617cae1c78dbd18edead351c9f3cd4786b6da34f4a927e51261555f85") #(mkPatch "0009-cameras" "1i5c16bx8drzagv5nkvmsyixvsz3w75lblabsmgxlh1znxsh7cj5")
(mkPatch "0010-amd-gpio" "8e30ff0ab332c05ec50e2d640a51888d8e6f0b1bb32b32a51efa1ea9ba676e06") # TODO: Maybe drop (mkPatch "0010-amd-gpio" "0qibdak0ivsch0r5kxd5hhmvw7rd75xy9mmxjbcmysv8q2y9m6hn") # TODO: Maybe drop
(mkPatch "0011-amd-s0ix" "33173ef8da66eb3ebe0b96585c751e6dd064d0947aaac41a9de97d513a038e85") # TODO: Maybe drop (mkPatch "0011-amd-s0ix" "0awv32wqwkjsxs1bhg82rqq3c4ni2f9vsdm7iscilbad28ngdab8") # TODO: Maybe drop
{ {
name = "surface-config"; name = "surface-config";
@ -52,26 +53,26 @@ in {
# #
# Surface Aggregator Module # Surface Aggregator Module
# #
CONFIG_SURFACE_AGGREGATOR=m SURFACE_AGGREGATOR m
CONFIG_SURFACE_AGGREGATOR_ERROR_INJECTION=n SURFACE_AGGREGATOR_ERROR_INJECTION n
CONFIG_SURFACE_AGGREGATOR_BUS=y SURFACE_AGGREGATOR_BUS y
CONFIG_SURFACE_AGGREGATOR_CDEV=m SURFACE_AGGREGATOR_CDEV m
CONFIG_SURFACE_AGGREGATOR_REGISTRY=m SURFACE_AGGREGATOR_REGISTRY m
CONFIG_SURFACE_ACPI_NOTIFY=m SURFACE_ACPI_NOTIFY m
CONFIG_SURFACE_DTX=m SURFACE_DTX m
CONFIG_SURFACE_PLATFORM_PROFILE=m SURFACE_PLATFORM_PROFILE m
CONFIG_SURFACE_HID=m SURFACE_HID m
CONFIG_SURFACE_KBD=m SURFACE_KBD m
CONFIG_BATTERY_SURFACE=m BATTERY_SURFACE m
CONFIG_CHARGER_SURFACE=m CHARGER_SURFACE m
# #
# Surface Hotplug # Surface Hotplug
# #
CONFIG_SURFACE_HOTPLUG=m SURFACE_HOTPLUG m
# #
# IPTS touchscreen # IPTS touchscreen
@ -79,38 +80,38 @@ in {
# This only enables the user interface for IPTS data. # This only enables the user interface for IPTS data.
# For the touchscreen to work, you need to install iptsd. # For the touchscreen to work, you need to install iptsd.
# #
CONFIG_MISC_IPTS=m MISC_IPTS m
# #
# Cameras: IPU3 # Cameras: IPU3
# #
CONFIG_VIDEO_IPU3_IMGU=m #VIDEO_IPU3_IMGU m
CONFIG_VIDEO_IPU3_CIO2=m VIDEO_IPU3_CIO2 m
CONFIG_CIO2_BRIDGE=y CIO2_BRIDGE y
CONFIG_INTEL_SKL_INT3472=m #INTEL_SKL_INT3472 m
# #
# Cameras: Sensor drivers # Cameras: Sensor drivers
# #
CONFIG_VIDEO_OV5693=m #VIDEO_OV5693 m
CONFIG_VIDEO_OV8865=m VIDEO_OV8865 m
# #
# ALS Sensor for Surface Book 3, Surface Laptop 3, Surface Pro 7 # ALS Sensor for Surface Book 3, Surface Laptop 3, Surface Pro 7
# #
CONFIG_APDS9960=m APDS9960 m
# #
# Other Drivers # Other Drivers
# #
CONFIG_INPUT_SOC_BUTTON_ARRAY=m INPUT_SOC_BUTTON_ARRAY m
CONFIG_SURFACE_3_BUTTON=m SURFACE_3_BUTTON m
CONFIG_SURFACE_3_POWER_OPREGION=m SURFACE_3_POWER_OPREGION m
CONFIG_SURFACE_PRO3_BUTTON=m SURFACE_PRO3_BUTTON m
CONFIG_SURFACE_GPE=m SURFACE_GPE m
CONFIG_SURFACE_BOOK1_DGPU_SWITCH=m SURFACE_BOOK1_DGPU_SWITCH m
''; '';
} }
] ];
}; };
} }