2022-12-05 04:32:25 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
2022-12-05 04:38:21 +00:00
|
|
|
inherit (lib) mkIf mkOption types;
|
2022-12-05 04:32:25 +00:00
|
|
|
inherit (pkgs) fetchurl;
|
|
|
|
|
|
|
|
inherit (pkgs.callPackage ../linux-package.nix { }) linuxPackage repos;
|
|
|
|
|
2022-12-05 04:39:24 +00:00
|
|
|
cfg = config.microsoft-surface;
|
2022-12-05 04:32:25 +00:00
|
|
|
|
|
|
|
version = "5.19.17";
|
|
|
|
extraMeta.branch = "5.19";
|
2022-12-05 04:38:21 +00:00
|
|
|
patchDir = repos.linux-surface + "/patches/${extraMeta.branch}";
|
|
|
|
kernelPatches = pkgs.callPackage ./patches.nix {
|
|
|
|
inherit (lib) kernel;
|
|
|
|
inherit version patchDir;
|
|
|
|
};
|
2022-12-05 04:32:25 +00:00
|
|
|
|
|
|
|
kernelPackages = linuxPackage {
|
2022-12-05 04:38:21 +00:00
|
|
|
inherit version extraMeta kernelPatches;
|
2022-12-05 04:32:25 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz";
|
|
|
|
sha256 = "sha256-yTuzhKl60fCk8Y5ELOApEkJyL3gCPspliyI0RUHwlIk=";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
in {
|
2022-12-05 04:39:24 +00:00
|
|
|
options.microsoft-surface.kernelVersion = mkOption {
|
2022-12-05 04:32:25 +00:00
|
|
|
type = types.enum [ "5.19.17" ];
|
|
|
|
};
|
|
|
|
|
2022-12-05 04:39:24 +00:00
|
|
|
config = mkIf (cfg.kernelVersion == "5.19.17") {
|
2022-12-05 04:32:25 +00:00
|
|
|
boot = {
|
|
|
|
inherit kernelPackages;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|