mirror of
https://github.com/NixOS/nixos-hardware
synced 2024-11-13 22:49:41 +01:00
31 lines
711 B
Nix
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.9.3";
|
|
kernelPatches = surfacePatches {
|
|
inherit version;
|
|
patchFn = ./patches.nix;
|
|
};
|
|
kernelPackages = linuxPackage {
|
|
inherit version kernelPatches;
|
|
sha256 = "1bnzxparybwh320019pr2msaapas41dhjmvg4gy791rn05jc88f3";
|
|
ignoreConfigErrors=true;
|
|
};
|
|
|
|
in {
|
|
options.microsoft-surface.kernelVersion = mkOption {
|
|
type = versionsOfEnum version;
|
|
};
|
|
|
|
config = mkIf (isVersionOf cfg.kernelVersion version) {
|
|
boot = {
|
|
inherit kernelPackages;
|
|
};
|
|
};
|
|
}
|