mirror of
https://github.com/NixOS/nixos-hardware.git
synced 2025-11-03 16:57:14 +08:00
Merge branch 'microsoft/surface/refactor-kernel-code' into microsoft/surface/kernel-6.0.11
This commit is contained in:
@@ -1,37 +1,16 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
# To test the kernel build:
|
||||
# nix-build -E "with import <nixpkgs> {}; (pkgs.callPackage ./. {}).boot.kernelPackages.kernel"
|
||||
|
||||
let
|
||||
inherit (lib) kernel recurseIntoAttrs;
|
||||
inherit (pkgs) buildLinux linuxPackagesFor;
|
||||
repos = pkgs.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_19_17 = linuxPackage (
|
||||
pkgs.callPackage ./linux-5.19.17.nix { inherit repos; }
|
||||
);
|
||||
|
||||
linux-6_0_11 = linuxPackage (
|
||||
pkgs.callPackage ./linux-6.0.11.nix { inherit repos; }
|
||||
);
|
||||
inherit (lib) mkOption types;
|
||||
|
||||
in {
|
||||
boot.kernelPackages = linux-6_0_11;
|
||||
imports = [
|
||||
./linux-5.19.17
|
||||
./linux-6.0.11
|
||||
];
|
||||
|
||||
options.microsoft-surface.kernelVersion = mkOption {
|
||||
description = "Kernel Version to use (patched for MS Surface)";
|
||||
type = types.enum [ ];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user