2023-11-25 18:43:48 -05:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
2024-01-31 03:32:59 -05:00
|
|
|
inherit (lib) mkIf mkOption;
|
2023-11-25 18:43:48 -05:00
|
|
|
|
2024-01-31 03:36:14 -05:00
|
|
|
inherit (pkgs.callPackage ../linux-package.nix { }) linuxPackage surfacePatches isVersionOf versionsOfEnum;
|
2023-11-25 18:43:48 -05:00
|
|
|
|
|
|
|
cfg = config.microsoft-surface;
|
|
|
|
|
2024-04-17 20:41:51 -04:00
|
|
|
version = "6.8.6";
|
2023-11-25 18:43:48 -05:00
|
|
|
kernelPatches = surfacePatches {
|
|
|
|
inherit version;
|
|
|
|
patchFn = ./patches.nix;
|
|
|
|
};
|
2024-01-30 18:00:03 -05:00
|
|
|
kernelPackages = linuxPackage {
|
2023-11-25 18:43:48 -05:00
|
|
|
inherit version kernelPatches;
|
2024-04-17 20:41:51 -04:00
|
|
|
sha256 = "sha256-nnIyMtYDq0Xr8EPDRxTEjyd6sZXCmry4Ry8qTDpaGZU=";
|
2024-01-16 12:41:29 -05:00
|
|
|
ignoreConfigErrors=true;
|
2023-11-25 18:43:48 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
in {
|
|
|
|
options.microsoft-surface.kernelVersion = mkOption {
|
2024-01-31 03:36:14 -05:00
|
|
|
type = versionsOfEnum version;
|
2023-11-25 18:43:48 -05:00
|
|
|
};
|
|
|
|
|
2024-01-31 03:32:59 -05:00
|
|
|
config = mkIf (isVersionOf cfg.kernelVersion version) {
|
2023-11-25 18:43:48 -05:00
|
|
|
boot = {
|
|
|
|
inherit kernelPackages;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|