mirror of
https://github.com/NixOS/nixos-hardware.git
synced 2025-11-06 09:58:47 +08:00
chore: format repo using treefmt-nix and nixfmt-rfc-style
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
{ lib,
|
||||
{
|
||||
lib,
|
||||
kernel ? lib.kernel,
|
||||
patchSrc,
|
||||
version,
|
||||
@@ -11,87 +12,87 @@
|
||||
extraStructuredConfig = with kernel; {
|
||||
STAGING_MEDIA = yes;
|
||||
|
||||
##
|
||||
## Surface Aggregator Module
|
||||
##
|
||||
CONFIG_SURFACE_AGGREGATOR= module;
|
||||
# CONFIG_SURFACE_AGGREGATOR_ERROR_INJECTION is not set
|
||||
CONFIG_SURFACE_AGGREGATOR_BUS= yes;
|
||||
CONFIG_SURFACE_AGGREGATOR_CDEV= module;
|
||||
CONFIG_SURFACE_AGGREGATOR_HUB= module;
|
||||
CONFIG_SURFACE_AGGREGATOR_REGISTRY= module;
|
||||
CONFIG_SURFACE_AGGREGATOR_TABLET_SWITCH= module;
|
||||
##
|
||||
## Surface Aggregator Module
|
||||
##
|
||||
CONFIG_SURFACE_AGGREGATOR = module;
|
||||
# CONFIG_SURFACE_AGGREGATOR_ERROR_INJECTION is not set
|
||||
CONFIG_SURFACE_AGGREGATOR_BUS = yes;
|
||||
CONFIG_SURFACE_AGGREGATOR_CDEV = module;
|
||||
CONFIG_SURFACE_AGGREGATOR_HUB = module;
|
||||
CONFIG_SURFACE_AGGREGATOR_REGISTRY = module;
|
||||
CONFIG_SURFACE_AGGREGATOR_TABLET_SWITCH = module;
|
||||
|
||||
CONFIG_SURFACE_ACPI_NOTIFY= module;
|
||||
CONFIG_SURFACE_DTX= module;
|
||||
CONFIG_SURFACE_PLATFORM_PROFILE= module;
|
||||
CONFIG_SURFACE_ACPI_NOTIFY = module;
|
||||
CONFIG_SURFACE_DTX = module;
|
||||
CONFIG_SURFACE_PLATFORM_PROFILE = module;
|
||||
|
||||
CONFIG_SURFACE_HID= module;
|
||||
CONFIG_SURFACE_KBD= module;
|
||||
CONFIG_SURFACE_HID = module;
|
||||
CONFIG_SURFACE_KBD = module;
|
||||
|
||||
CONFIG_BATTERY_SURFACE= module;
|
||||
CONFIG_CHARGER_SURFACE= module;
|
||||
CONFIG_BATTERY_SURFACE = module;
|
||||
CONFIG_CHARGER_SURFACE = module;
|
||||
|
||||
CONFIG_SENSORS_SURFACE_TEMP= module;
|
||||
CONFIG_SENSORS_SURFACE_FAN= module;
|
||||
CONFIG_SENSORS_SURFACE_TEMP = module;
|
||||
CONFIG_SENSORS_SURFACE_FAN = module;
|
||||
|
||||
##
|
||||
## Surface Hotplug
|
||||
##
|
||||
CONFIG_SURFACE_HOTPLUG= module;
|
||||
##
|
||||
## Surface Hotplug
|
||||
##
|
||||
CONFIG_SURFACE_HOTPLUG = module;
|
||||
|
||||
##
|
||||
## IPTS and ITHC touchscreen
|
||||
##
|
||||
## This only enables the user interface for IPTS/ITHC data.
|
||||
## For the touchscreen to work, you need to install iptsd.
|
||||
##
|
||||
CONFIG_HID_IPTS= module;
|
||||
CONFIG_HID_ITHC= module;
|
||||
##
|
||||
## IPTS and ITHC touchscreen
|
||||
##
|
||||
## This only enables the user interface for IPTS/ITHC data.
|
||||
## For the touchscreen to work, you need to install iptsd.
|
||||
##
|
||||
CONFIG_HID_IPTS = module;
|
||||
CONFIG_HID_ITHC = module;
|
||||
|
||||
##
|
||||
## Cameras: IPU3
|
||||
##
|
||||
CONFIG_VIDEO_DW9719= module;
|
||||
CONFIG_VIDEO_IPU3_IMGU= module;
|
||||
CONFIG_VIDEO_IPU3_CIO2= module;
|
||||
CONFIG_IPU_BRIDGE= module;
|
||||
CONFIG_INTEL_SKL_INT3472= module;
|
||||
CONFIG_REGULATOR_TPS68470= module;
|
||||
CONFIG_COMMON_CLK_TPS68470= module;
|
||||
CONFIG_LEDS_TPS68470= module;
|
||||
##
|
||||
## Cameras: IPU3
|
||||
##
|
||||
CONFIG_VIDEO_DW9719 = module;
|
||||
CONFIG_VIDEO_IPU3_IMGU = module;
|
||||
CONFIG_VIDEO_IPU3_CIO2 = module;
|
||||
CONFIG_IPU_BRIDGE = module;
|
||||
CONFIG_INTEL_SKL_INT3472 = module;
|
||||
CONFIG_REGULATOR_TPS68470 = module;
|
||||
CONFIG_COMMON_CLK_TPS68470 = module;
|
||||
CONFIG_LEDS_TPS68470 = module;
|
||||
|
||||
##
|
||||
## Cameras: Sensor drivers
|
||||
##
|
||||
CONFIG_VIDEO_OV5693= module;
|
||||
CONFIG_VIDEO_OV7251= module;
|
||||
CONFIG_VIDEO_OV8865= module;
|
||||
##
|
||||
## Cameras: Sensor drivers
|
||||
##
|
||||
CONFIG_VIDEO_OV5693 = module;
|
||||
CONFIG_VIDEO_OV7251 = module;
|
||||
CONFIG_VIDEO_OV8865 = module;
|
||||
|
||||
##
|
||||
## Surface 3: atomisp causes problems (see issue #1095). Disable it for now.
|
||||
##
|
||||
# CONFIG_INTEL_ATOMISP is not set
|
||||
##
|
||||
## Surface 3: atomisp causes problems (see issue #1095). Disable it for now.
|
||||
##
|
||||
# CONFIG_INTEL_ATOMISP is not set
|
||||
|
||||
##
|
||||
## ALS Sensor for Surface Book 3, Surface Laptop 3, Surface Pro 7
|
||||
##
|
||||
CONFIG_APDS9960= module;
|
||||
##
|
||||
## ALS Sensor for Surface Book 3, Surface Laptop 3, Surface Pro 7
|
||||
##
|
||||
CONFIG_APDS9960 = module;
|
||||
|
||||
##
|
||||
## Build-in UFS support (required for some Surface Go devices)
|
||||
##
|
||||
CONFIG_SCSI_UFSHCD= module;
|
||||
CONFIG_SCSI_UFSHCD_PCI= module;
|
||||
##
|
||||
## Build-in UFS support (required for some Surface Go devices)
|
||||
##
|
||||
CONFIG_SCSI_UFSHCD = module;
|
||||
CONFIG_SCSI_UFSHCD_PCI = module;
|
||||
|
||||
##
|
||||
## Other Drivers
|
||||
##
|
||||
CONFIG_INPUT_SOC_BUTTON_ARRAY= module;
|
||||
CONFIG_SURFACE_3_POWER_OPREGION= module;
|
||||
CONFIG_SURFACE_PRO3_BUTTON= module;
|
||||
CONFIG_SURFACE_GPE= module;
|
||||
CONFIG_SURFACE_BOOK1_DGPU_SWITCH= module;
|
||||
##
|
||||
## Other Drivers
|
||||
##
|
||||
CONFIG_INPUT_SOC_BUTTON_ARRAY = module;
|
||||
CONFIG_SURFACE_3_POWER_OPREGION = module;
|
||||
CONFIG_SURFACE_PRO3_BUTTON = module;
|
||||
CONFIG_SURFACE_GPE = module;
|
||||
CONFIG_SURFACE_BOOK1_DGPU_SWITCH = module;
|
||||
};
|
||||
}
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{ lib,
|
||||
{
|
||||
lib,
|
||||
kernel ? lib.kernel,
|
||||
patchSrc,
|
||||
version,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{ pkgs,
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
fetchurl,
|
||||
buildLinux,
|
||||
@@ -11,44 +12,73 @@ let
|
||||
inherit (lib) recurseIntoAttrs types versions;
|
||||
|
||||
linuxPackage =
|
||||
{ url ? "mirror://kernel/linux/kernel/v${versions.major version}.x/linux-${version}.tar.xz",
|
||||
{
|
||||
url ? "mirror://kernel/linux/kernel/v${versions.major version}.x/linux-${version}.tar.xz",
|
||||
sha256 ? null,
|
||||
src ? (fetchurl { inherit url sha256; }),
|
||||
version,
|
||||
modDirVersion ? (versions.pad 3 version),
|
||||
kernelPatches ? [],
|
||||
kernelPatches ? [ ],
|
||||
...
|
||||
} @ args: let
|
||||
}@args:
|
||||
let
|
||||
inherit (builtins) removeAttrs;
|
||||
|
||||
args' = {
|
||||
inherit src version modDirVersion kernelPatches;
|
||||
} // removeAttrs args [ "url" "sha256" ];
|
||||
args' =
|
||||
{
|
||||
inherit
|
||||
src
|
||||
version
|
||||
modDirVersion
|
||||
kernelPatches
|
||||
;
|
||||
}
|
||||
// removeAttrs args [
|
||||
"url"
|
||||
"sha256"
|
||||
];
|
||||
linuxPackage = buildLinux args';
|
||||
linuxPackages' = recurseIntoAttrs (linuxPackagesFor linuxPackage);
|
||||
in linuxPackages';
|
||||
in
|
||||
linuxPackages';
|
||||
|
||||
surfacePatches =
|
||||
{ patchSrc ? (repos.linux-surface + "/patches/${versions.majorMinor version}"),
|
||||
{
|
||||
patchSrc ? (repos.linux-surface + "/patches/${versions.majorMinor version}"),
|
||||
version,
|
||||
patchFn,
|
||||
}: pkgs.callPackage patchFn {
|
||||
}:
|
||||
pkgs.callPackage patchFn {
|
||||
inherit (lib) kernel;
|
||||
inherit version patchSrc;
|
||||
};
|
||||
|
||||
versionsOf = version:
|
||||
versionsOf =
|
||||
version:
|
||||
# Provides a list of versions that can be used as an enum option for this full version:
|
||||
[ version (versions.majorMinor version) ];
|
||||
[
|
||||
version
|
||||
(versions.majorMinor version)
|
||||
];
|
||||
|
||||
versionsOfEnum = version:
|
||||
versionsOfEnum =
|
||||
version:
|
||||
# Provide an enum option for versions of this kernel:
|
||||
types.enum (versionsOf version);
|
||||
|
||||
isVersionOf = kernelVersion: version:
|
||||
isVersionOf =
|
||||
kernelVersion: version:
|
||||
# Test if the provided version is considered one of the list of versions from above:
|
||||
elem kernelVersion (versionsOf version);
|
||||
|
||||
in {
|
||||
inherit linuxPackage repos surfacePatches versionsOf isVersionOf versionsOfEnum;
|
||||
in
|
||||
{
|
||||
inherit
|
||||
linuxPackage
|
||||
repos
|
||||
surfacePatches
|
||||
versionsOf
|
||||
isVersionOf
|
||||
versionsOfEnum
|
||||
;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user