mirror of
https://github.com/NixOS/nixos-hardware
synced 2024-12-18 07:39:45 +01:00
DRY the MS Surface kernel module
This commit is contained in:
parent
35e317a280
commit
158f86bb32
1 changed files with 35 additions and 3 deletions
|
@ -1,5 +1,37 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ lib,
|
||||||
|
buildLinux,
|
||||||
|
callPackage,
|
||||||
|
linuxPackagesFor,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
{
|
# To test the kernel build:
|
||||||
boot.kernelPackages = pkgs.callPackage ./linux-5.16.11.nix { };
|
# nix-build -E "with import <nixpkgs> {}; (pkgs.callPackage ./. {}).kernel"
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) kernel recurseIntoAttrs;
|
||||||
|
repos = callPackage ../repos.nix {};
|
||||||
|
|
||||||
|
linuxPackage =
|
||||||
|
{ version,
|
||||||
|
modDirVersion ? version,
|
||||||
|
branch,
|
||||||
|
src,
|
||||||
|
kernelPatches ? [],
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
buildLinux' = buildLinux {
|
||||||
|
inherit version src kernelPatches;
|
||||||
|
modDirVersion = version;
|
||||||
|
extraMeta.branch = branch;
|
||||||
|
};
|
||||||
|
linuxPackagesFor' = (linuxPackagesFor buildLinux');
|
||||||
|
in recurseIntoAttrs linuxPackagesFor';
|
||||||
|
|
||||||
|
linux-5_16_11 = linuxPackage (
|
||||||
|
callPackage ./linux-5.16.11.nix { inherit repos; }
|
||||||
|
);
|
||||||
|
|
||||||
|
in {
|
||||||
|
boot.kernelPackages = linux-5_16_11;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue