1
0
Fork 0
mirror of https://github.com/NixOS/nixos-hardware synced 2024-12-23 18:19:44 +01:00

Use the newly refactored code

This commit is contained in:
mexisme 2022-11-28 20:28:52 +13:00
parent 158f86bb32
commit 3de7b6e0c5
2 changed files with 79 additions and 79 deletions

View file

@ -6,7 +6,7 @@
}: }:
# To test the kernel build: # To test the kernel build:
# nix-build -E "with import <nixpkgs> {}; (pkgs.callPackage ./. {}).kernel" # nix-build -E "with import <nixpkgs> {}; (pkgs.callPackage ./. {}).boot.kernelPackages.kernel"
let let
inherit (lib) kernel recurseIntoAttrs; inherit (lib) kernel recurseIntoAttrs;

View file

@ -1,91 +1,91 @@
{ lib, callPackage, linuxPackagesFor, ... }: { lib,
# To test the kernel build: repos,
# nix-build -E "with import <nixpkgs> {}; (pkgs.callPackage ./linux-5.16.11.nix {}).kernel" }:
let let
repos = callPackage ../repos.nix {}; inherit (lib) kernel;
linuxPkg = { fetchurl, buildLinux, ... }@args: version = "5.16.11";
buildLinux (args // rec {
version = "5.16.11";
modDirVersion = version;
extraMeta.branch = "5.16";
src = repos.linux-surface-kernel { in {
# Kernel 5.16.11 inherit version;
rev = "db94c89f56d6ceae03ca3802e11197f48e6c539f"; modDirVersion = version;
sha256 = "0c58ri0i9gdb4w7l361pnkvq6ap17kmgnxngh0bcdmgn4dc88wx2"; branch = "5.16";
}; src = repos.linux-surface-kernel {
# Kernel 5.16.11 from the linux-surface/kernel repo:
rev = "db94c89f56d6ceae03ca3802e11197f48e6c539f";
sha256 = "0c58ri0i9gdb4w7l361pnkvq6ap17kmgnxngh0bcdmgn4dc88wx2";
};
kernelPatches = [{
name = "microsoft-surface-patches-linux-${version}";
patch = null;
structuredExtraConfig = with kernel; {
#
# Surface Aggregator Module
#
SURFACE_AGGREGATOR = module;
SURFACE_AGGREGATOR_ERROR_INJECTION = no;
SURFACE_AGGREGATOR_BUS = yes;
SURFACE_AGGREGATOR_CDEV = module;
SURFACE_AGGREGATOR_REGISTRY = module;
kernelPatches = [{ SURFACE_ACPI_NOTIFY = module;
name = "microsoft-surface-patches-linux-5.16.2"; SURFACE_DTX = module;
patch = null; SURFACE_PLATFORM_PROFILE = module;
structuredExtraConfig = with lib.kernel; {
#
# Surface Aggregator Module
#
SURFACE_AGGREGATOR = module;
SURFACE_AGGREGATOR_ERROR_INJECTION = no;
SURFACE_AGGREGATOR_BUS = yes;
SURFACE_AGGREGATOR_CDEV = module;
SURFACE_AGGREGATOR_REGISTRY = module;
SURFACE_ACPI_NOTIFY = module; SURFACE_HID = module;
SURFACE_DTX = module; SURFACE_KBD = module;
SURFACE_PLATFORM_PROFILE = module;
SURFACE_HID = module; BATTERY_SURFACE = module;
SURFACE_KBD = module; CHARGER_SURFACE = module;
BATTERY_SURFACE = module; #
CHARGER_SURFACE = module; # Surface laptop 1 keyboard
#
SERIAL_DEV_BUS = yes;
SERIAL_DEV_CTRL_TTYPORT = yes;
# #
# Surface laptop 1 keyboard # Surface Hotplug
# #
SERIAL_DEV_BUS = yes; SURFACE_HOTPLUG = module;
SERIAL_DEV_CTRL_TTYPORT = yes;
# #
# Surface Hotplug # IPTS touchscreen
# #
SURFACE_HOTPLUG = module; # This only enables the user interface for IPTS data.
# For the touchscreen to work, you need to install iptsd.
#
MISC_IPTS = module;
# #
# IPTS touchscreen # Cameras: IPU3
# #
# This only enables the user interface for IPTS data. VIDEO_IPU3_IMGU = module;
# For the touchscreen to work, you need to install iptsd. VIDEO_IPU3_CIO2 = module;
# CIO2_BRIDGE = yes;
MISC_IPTS = module; INTEL_SKL_INT3472 = module;
# #
# Cameras: IPU3 # Cameras: Sensor drivers
# #
VIDEO_IPU3_IMGU = module; VIDEO_OV5693 = module;
VIDEO_IPU3_CIO2 = module; VIDEO_OV8865 = module;
CIO2_BRIDGE = yes;
INTEL_SKL_INT3472 = module;
# #
# Cameras: Sensor drivers # ALS Sensor for Surface Book 3, Surface Laptop 3, Surface Pro 7
# #
VIDEO_OV5693 = module; APDS9960 = module;
VIDEO_OV8865 = module;
# #
# ALS Sensor for Surface Book 3, Surface Laptop 3, Surface Pro 7 # Other Drivers
# #
APDS9960 = module; INPUT_SOC_BUTTON_ARRAY = module;
SURFACE_3_BUTTON = module;
SURFACE_3_POWER_OPREGION = module;
SURFACE_PRO3_BUTTON = module;
SURFACE_GPE = module;
SURFACE_BOOK1_DGPU_SWITCH = module;
};
}];
}
#
# Other Drivers
#
INPUT_SOC_BUTTON_ARRAY = module;
SURFACE_3_BUTTON = module;
SURFACE_3_POWER_OPREGION = module;
SURFACE_PRO3_BUTTON = module;
SURFACE_GPE = module;
SURFACE_BOOK1_DGPU_SWITCH = module;
};
}];
} // (args.argsOverride or {}));
in lib.recurseIntoAttrs (linuxPackagesFor (callPackage linuxPkg {}))