I run NixOS on my Surface Pro 5, which requires several kernel patches to get the touch screen and battery readings, among other things, to work properly. I apply these patches using the relevant NixOS configuration options, which amounts to overriding linux_4_19 with extraConfig and setting boot.kernelPatches. Here’s the related portions of my config, although I don’t think the problem results from this:
{ config, pkgs, options, ... }:
{
nixpkgs = {
overlays = [
(self: super: {
linux_4_19 = super.linux_4_19.override {
extraConfig = ''
SERIAL_DEV_BUS y
SERIAL_DEV_CTRL_TTYPORT y
SURFACE_SAM y
SURFACE_SAM_SSH m
SURFACE_SAM_SAN m
SURFACE_SAM_VHF m
SURFACE_SAM_DTX m
SURFACE_SAM_SID n
INPUT_SOC_BUTTON_ARRAY m
INTEL_IPTS m
INTEL_IPTS_SURFACE m
MWLWIFI n
'';
# ignoreConfigErrors = true;
};
})
];
};
boot = {
kernelPackages = pkgs.linuxPackages_4_19;
kernelPatches = [
{
name = "surface-acpi";
patch = ./pkgs/linux/patches/4.19/0001-surface-acpi.patch;
}
{
name = "surface-suspend";
patch = ./pkgs/linux/patches/4.19/0002-suspend.patch;
}
{
name = "surface-buttons";
patch = ./pkgs/linux/patches/4.19/0003-buttons.patch;
}
{
name = "surface-cameras";
patch = ./pkgs/linux/patches/4.19/0004-cameras.patch;
}
{
name = "surface-ipts";
patch = ./pkgs/linux/patches/4.19/0005-ipts.patch;
}
{
name = "surface-hid";
patch = ./pkgs/linux/patches/4.19/0006-hid.patch;
}
{
name = "surface-sd";
patch = ./pkgs/linux/patches/4.19/0007-sdcard-reader.patch;
}
{
name = "surface-wifi";
patch = ./pkgs/linux/patches/4.19/0008-wifi.patch;
}
{
name = "surface-mwlwifi";
patch = ./pkgs/linux/patches/4.19/0010-mwlwifi.patch;
}
];
# extraModulePackages = [ pkgs.mwlwifi ]; # not sure of diff between this and hw.fw
kernelModules = [ "hid" "hid_sensor_hub" "hid_generic" "usbhid" "hid_multitouch" "intel_ipts" ]; # surface_acpi not in lsmod?
};
Sorry I don’t have a GitHub repo yet, I have to figure out how to deal with secrets properly.
I’m currently on 4.19.74, which works fine, and a bunch of previous versions compiled with these options as well. The latest version is not compiling due to varying gcc
errors that ask me to “Please submit a full bug report” followed by make errors (presumably caused by the gcc
errors). Most recently, it was in ../drivers/net/ethernet/cisco/enic/vnic_devcmd.h,
and in general, never have the gcc
errors seemed tied to my patches or config in any way. This has happened for .78, .79, and .80.
How can I try to resolve this? Thanks!