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