nixos-hardware/microsoft/surface/kernel/linux-5.19.17/default.nix

38 lines
907 B
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
let
2022-12-05 04:38:21 +00:00
inherit (lib) mkIf mkOption types;
inherit (pkgs) fetchurl;
inherit (pkgs.callPackage ../linux-package.nix { }) linuxPackage repos;
2022-12-05 04:39:24 +00:00
cfg = config.microsoft-surface;
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;
};
kernelPackages = linuxPackage {
2022-12-05 04:38:21 +00:00
inherit version extraMeta kernelPatches;
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 {
type = types.enum [ "5.19.17" ];
};
2022-12-05 04:39:24 +00:00
config = mkIf (cfg.kernelVersion == "5.19.17") {
boot = {
inherit kernelPackages;
};
};
}