1
0
Fork 0
mirror of https://github.com/NixOS/nixos-hardware synced 2024-11-01 08:39:41 +01:00
nixos-hardware/microsoft/surface/common/kernel/linux-5.19.17/default.nix

38 lines
907 B
Nix
Raw Normal View History

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