1
0
Fork 0
mirror of https://github.com/NixOS/nixos-hardware synced 2025-01-30 20:55:01 +01:00
nixos-hardware/microsoft/surface/common/kernel/linux-surface/default.nix
2024-12-28 12:17:01 +00:00

31 lines
711 B
Nix

{ config, lib, pkgs, ... }:
let
inherit (lib) mkIf mkOption;
inherit (pkgs.callPackage ../linux-package.nix { }) linuxPackage surfacePatches isVersionOf versionsOfEnum;
cfg = config.microsoft-surface;
version = "6.12.7";
kernelPatches = surfacePatches {
inherit version;
patchFn = ./patches.nix;
};
kernelPackages = linuxPackage {
inherit version kernelPatches;
sha256 = "sha256-94X7ZIoOC2apQ7syKKS27WLJC5hc0ev2naXTjlidoM8=";
ignoreConfigErrors=true;
};
in {
options.microsoft-surface.kernelVersion = mkOption {
type = versionsOfEnum version;
};
config = mkIf (isVersionOf cfg.kernelVersion version) {
boot = {
inherit kernelPackages;
};
};
}