Rearrange the kernels to make them self-defining

This commit is contained in:
mexisme
2022-12-05 17:32:25 +13:00
parent f99c9d5b1f
commit e37520e48b
5 changed files with 188 additions and 162 deletions

View File

@@ -1,33 +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; }
);
inherit (lib) mkOption types;
in {
boot.kernelPackages = linux-5_19_17;
imports = [
./linux-5.19.17
];
options.microsoft-surface.kernel-version = mkOption {
description = "Kernel Version to use (patched for MS Surface)";
type = types.enum [ ];
# default = "5.19.17";
};
}