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

38 lines
919 B
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
2022-11-28 02:23:51 -05:00
# To test the kernel build:
2022-11-28 02:28:52 -05:00
# nix-build -E "with import <nixpkgs> {}; (pkgs.callPackage ./. {}).boot.kernelPackages.kernel"
2022-11-28 02:23:51 -05:00
let
inherit (lib) kernel recurseIntoAttrs;
inherit (pkgs) buildLinux linuxPackagesFor;
repos = pkgs.callPackage ../repos.nix {};
2022-11-28 02:23:51 -05: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 02:23:51 -05:00
in recurseIntoAttrs linuxPackagesFor';
linux-5_19_17 = linuxPackage (
pkgs.callPackage ./linux-5.19.17.nix { inherit repos; }
2022-11-28 02:23:51 -05:00
);
linux-6_0_11 = linuxPackage (
pkgs.callPackage ./linux-6.0.11.nix { inherit repos; }
);
2022-11-28 02:23:51 -05:00
in {
boot.kernelPackages = linux-6_0_11;
}