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

34 lines
823 B
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
2022-11-28 08:23:51 +01:00
# To test the kernel build:
2022-11-28 08:28:52 +01:00
# nix-build -E "with import <nixpkgs> {}; (pkgs.callPackage ./. {}).boot.kernelPackages.kernel"
2022-11-28 08:23:51 +01:00
let
inherit (lib) kernel recurseIntoAttrs;
inherit (pkgs) buildLinux linuxPackagesFor;
repos = pkgs.callPackage ../repos.nix {};
2022-11-28 08:23:51 +01:00
linuxPackage =
{ version,
modDirVersion ? version,
branch,
src,
kernelPatches ? [],
...
}: let
buildLinux' = buildLinux {
inherit version src kernelPatches;
modDirVersion = version;
extraMeta.branch = branch;
};
linuxPackagesFor' = linuxPackagesFor buildLinux';
2022-11-28 08:23:51 +01:00
in recurseIntoAttrs linuxPackagesFor';
linux-5_19_17 = linuxPackage (
pkgs.callPackage ./linux-5.19.17.nix { inherit repos; }
2022-11-28 08:23:51 +01:00
);
in {
boot.kernelPackages = linux-5_19_17;
}