diff --git a/pkgs/os-specific/linux/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix index dce2ed074a05..51ad268a5fe7 100644 --- a/pkgs/os-specific/linux/kernel/generic.nix +++ b/pkgs/os-specific/linux/kernel/generic.nix @@ -195,8 +195,8 @@ let }; }; # end of configfile derivation - kernel = (callPackage ./manual-config.nix { inherit buildPackages; }) (basicArgs // { - inherit kernelPatches randstructSeed lib stdenv extraMakeFlags extraMeta configfile; + kernel = (callPackage ./manual-config.nix { inherit lib stdenv buildPackages; }) (basicArgs // { + inherit kernelPatches randstructSeed extraMakeFlags extraMeta configfile; pos = builtins.unsafeGetAttrPos "version" args; config = { CONFIG_MODULES = "y"; CONFIG_FW_LOADER = "m"; }; diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix index 1ba5495fc90e..45281d5d3bdb 100644 --- a/pkgs/os-specific/linux/kernel/manual-config.nix +++ b/pkgs/os-specific/linux/kernel/manual-config.nix @@ -1,8 +1,11 @@ -{ lib, buildPackages, runCommand, nettools, bc, bison, flex, perl, rsync, gmp, libmpc, mpfr, openssl +{ lib, stdenv, buildPackages, runCommand, nettools, bc, bison, flex, perl, rsync, gmp, libmpc, mpfr, openssl , libelf, cpio, elfutils, zstd, python3Minimal, zlib, pahole }: let + lib_ = lib; + stdenv_ = stdenv; + readConfig = configfile: import (runCommand "config.nix" {} '' echo "{" > "$out" while IFS='=' read key val; do @@ -12,10 +15,7 @@ let done < "${configfile}" echo "}" >> $out '').outPath; -in { - lib, - # Allow overriding stdenv on each buildLinux call - stdenv, +in lib.makeOverridable ({ # The kernel version version, # Position of the Linux build expression @@ -48,7 +48,7 @@ in { # Whether to utilize the controversial import-from-derivation feature to parse the config allowImportFromDerivation ? false, # ignored - features ? null, + features ? null, lib ? lib_, stdenv ? stdenv_, }: let @@ -387,4 +387,4 @@ stdenv.mkDerivation ((drvAttrs config stdenv.hostPlatform.linux-kernel kernelPat ++ extraMakeFlags; karch = stdenv.hostPlatform.linuxArch; -} // (optionalAttrs (pos != null) { inherit pos; })) +} // (optionalAttrs (pos != null) { inherit pos; }))) diff --git a/pkgs/top-level/linux-kernels.nix b/pkgs/top-level/linux-kernels.nix index da4270896f67..d6c9bd3ceeae 100644 --- a/pkgs/top-level/linux-kernels.nix +++ b/pkgs/top-level/linux-kernels.nix @@ -593,11 +593,11 @@ in { linux_hardkernel_latest = packages.hardkernel_4_14; }; - manualConfig = makeOverridable (callPackage ../os-specific/linux/kernel/manual-config.nix {}); + manualConfig = callPackage ../os-specific/linux/kernel/manual-config.nix {}; customPackage = { version, src, modDirVersion ? lib.versions.pad 3 version, configfile, allowImportFromDerivation ? true }: recurseIntoAttrs (packagesFor (manualConfig { - inherit version src modDirVersion configfile lib stdenv allowImportFromDerivation; + inherit version src modDirVersion configfile allowImportFromDerivation; })); # Derive one of the default .config files