From 2da1ad60a8ccc2946cfb6f547453ce2387a06bae Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Sun, 24 Mar 2019 22:04:15 +0900 Subject: [PATCH] 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. --- nixos/modules/system/boot/kernel.nix | 1 + pkgs/os-specific/linux/prl-tools/default.nix | 2 -- pkgs/top-level/all-packages.nix | 9 +++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/nixos/modules/system/boot/kernel.nix b/nixos/modules/system/boot/kernel.nix index ee43fe100238..baa8c602a99e 100644 --- a/nixos/modules/system/boot/kernel.nix +++ b/nixos/modules/system/boot/kernel.nix @@ -36,6 +36,7 @@ in boot.kernelPackages = mkOption { default = pkgs.linuxPackages; + type = types.unspecified // { merge = mergeEqualOption; }; apply = kernelPackages: kernelPackages.extend (self: super: { kernel = super.kernel.override { inherit randstructSeed; diff --git a/pkgs/os-specific/linux/prl-tools/default.nix b/pkgs/os-specific/linux/prl-tools/default.nix index 1a4919a5d9d4..9edf924b32fc 100644 --- a/pkgs/os-specific/linux/prl-tools/default.nix +++ b/pkgs/os-specific/linux/prl-tools/default.nix @@ -5,8 +5,6 @@ }: 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; xorgVer = lib.concatStringsSep "." (lib.take 2 (lib.splitString "." xorgFullVer)); diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f69d103a7f62..a316e1082df8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -15636,7 +15636,7 @@ in 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 { inherit kernel; @@ -15657,7 +15657,7 @@ in 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 {}; @@ -15706,7 +15706,7 @@ in 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 { }; @@ -15725,7 +15725,8 @@ in 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 { };