2023-11-26 00:43:48 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
2024-01-31 09:32:59 +01:00
|
|
|
inherit (lib) mkIf mkOption;
|
2023-11-26 00:43:48 +01:00
|
|
|
|
2024-01-31 09:36:14 +01:00
|
|
|
inherit (pkgs.callPackage ../linux-package.nix { }) linuxPackage surfacePatches isVersionOf versionsOfEnum;
|
2023-11-26 00:43:48 +01:00
|
|
|
|
|
|
|
cfg = config.microsoft-surface;
|
|
|
|
|
2024-06-10 22:24:42 +02:00
|
|
|
version = "6.9.3";
|
2023-11-26 00:43:48 +01:00
|
|
|
kernelPatches = surfacePatches {
|
|
|
|
inherit version;
|
|
|
|
patchFn = ./patches.nix;
|
|
|
|
};
|
2024-01-31 00:00:03 +01:00
|
|
|
kernelPackages = linuxPackage {
|
2023-11-26 00:43:48 +01:00
|
|
|
inherit version kernelPatches;
|
2024-06-10 22:24:42 +02:00
|
|
|
sha256 = "1bnzxparybwh320019pr2msaapas41dhjmvg4gy791rn05jc88f3";
|
2024-01-16 18:41:29 +01:00
|
|
|
ignoreConfigErrors=true;
|
2023-11-26 00:43:48 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
in {
|
|
|
|
options.microsoft-surface.kernelVersion = mkOption {
|
2024-01-31 09:36:14 +01:00
|
|
|
type = versionsOfEnum version;
|
2023-11-26 00:43:48 +01:00
|
|
|
};
|
|
|
|
|
2024-01-31 09:32:59 +01:00
|
|
|
config = mkIf (isVersionOf cfg.kernelVersion version) {
|
2023-11-26 00:43:48 +01:00
|
|
|
boot = {
|
|
|
|
inherit kernelPackages;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|