boot.kernelPackages: check for conflicts

It's currently possible to set conflicting `boot.kernelPackages` several times
which can prove confusing.
This is an attempt to warn for this.
This commit is contained in:
Matthieu Coudron 2019-03-24 22:04:15 +09:00
parent 63fa75e34c
commit 2da1ad60a8
3 changed files with 6 additions and 6 deletions

View File

@ -36,6 +36,7 @@ in
boot.kernelPackages = mkOption { boot.kernelPackages = mkOption {
default = pkgs.linuxPackages; default = pkgs.linuxPackages;
type = types.unspecified // { merge = mergeEqualOption; };
apply = kernelPackages: kernelPackages.extend (self: super: { apply = kernelPackages: kernelPackages.extend (self: super: {
kernel = super.kernel.override { kernel = super.kernel.override {
inherit randstructSeed; inherit randstructSeed;

View File

@ -5,8 +5,6 @@
}: }:
assert (!libsOnly) -> kernel != null; assert (!libsOnly) -> kernel != null;
# Disable for kernels 4.15 and above due to compatibility issues
assert kernel != null -> stdenv.lib.versionOlder kernel.version "4.15";
let xorgFullVer = (builtins.parseDrvName xorg.xorgserver.name).version; let xorgFullVer = (builtins.parseDrvName xorg.xorgserver.name).version;
xorgVer = lib.concatStringsSep "." (lib.take 2 (lib.splitString "." xorgFullVer)); xorgVer = lib.concatStringsSep "." (lib.take 2 (lib.splitString "." xorgFullVer));

View File

@ -15636,7 +15636,7 @@ in
ati_drivers_x11 = callPackage ../os-specific/linux/ati-drivers { }; ati_drivers_x11 = callPackage ../os-specific/linux/ati-drivers { };
blcr = callPackage ../os-specific/linux/blcr { }; blcr = if builtins.compareVersions "3.18" kernel.version == 1 then callPackage ../os-specific/linux/blcr { } else null;
chipsec = callPackage ../tools/security/chipsec { chipsec = callPackage ../tools/security/chipsec {
inherit kernel; inherit kernel;
@ -15657,7 +15657,7 @@ in
hyperv-daemons = callPackage ../os-specific/linux/hyperv-daemons { }; hyperv-daemons = callPackage ../os-specific/linux/hyperv-daemons { };
e1000e = callPackage ../os-specific/linux/e1000e {}; e1000e = if stdenv.lib.versionOlder kernel.version "4.10" then callPackage ../os-specific/linux/e1000e {} else null;
ixgbevf = callPackage ../os-specific/linux/ixgbevf {}; ixgbevf = callPackage ../os-specific/linux/ixgbevf {};
@ -15706,7 +15706,7 @@ in
facetimehd = callPackage ../os-specific/linux/facetimehd { }; facetimehd = callPackage ../os-specific/linux/facetimehd { };
jool = callPackage ../os-specific/linux/jool { }; jool = if stdenv.lib.versionOlder kernel.version "4.18" then callPackage ../os-specific/linux/jool { } else null;
mba6x_bl = callPackage ../os-specific/linux/mba6x_bl { }; mba6x_bl = callPackage ../os-specific/linux/mba6x_bl { };
@ -15725,7 +15725,8 @@ in
phc-intel = callPackage ../os-specific/linux/phc-intel { }; phc-intel = callPackage ../os-specific/linux/phc-intel { };
prl-tools = callPackage ../os-specific/linux/prl-tools { }; # Disable for kernels 4.15 and above due to compatibility issues
prl-tools = if stdenv.lib.versionOlder kernel.version "4.15" then null else callPackage ../os-specific/linux/prl-tools { };
sch_cake = callPackage ../os-specific/linux/sch_cake { }; sch_cake = callPackage ../os-specific/linux/sch_cake { };