nixos-hardware/microsoft/surface/common/kernel/linux-6.9.x/default.nix

32 lines
711 B
Nix
Raw Normal View History

2023-11-25 18:43:48 -05:00
{ config, lib, pkgs, ... }:
let
inherit (lib) mkIf mkOption;
2023-11-25 18:43:48 -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-06-10 16:24:42 -04:00
version = "6.9.3";
2023-11-25 18:43:48 -05:00
kernelPatches = surfacePatches {
inherit version;
patchFn = ./patches.nix;
};
kernelPackages = linuxPackage {
2023-11-25 18:43:48 -05:00
inherit version kernelPatches;
2024-06-10 16:24:42 -04:00
sha256 = "1bnzxparybwh320019pr2msaapas41dhjmvg4gy791rn05jc88f3";
ignoreConfigErrors=true;
2023-11-25 18:43:48 -05:00
};
in {
options.microsoft-surface.kernelVersion = mkOption {
type = versionsOfEnum version;
2023-11-25 18:43:48 -05:00
};
config = mkIf (isVersionOf cfg.kernelVersion version) {
2023-11-25 18:43:48 -05:00
boot = {
inherit kernelPackages;
};
};
}