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