linuxManualConfig: don't require lib and stdenv arguments

Reverts 7c7c83e233 which was
only needed for the minimal-kernel.nix test module and clutters the call site.

stdenv can still be overridden with `linuxManualConfig.override { stdenv = ...; }`.
This commit is contained in:
Naïm Favier 2022-12-20 14:42:38 +01:00
parent f677cbabe9
commit 6c563f30fe
No known key found for this signature in database
GPG Key ID: 95AFCE8211908325
3 changed files with 11 additions and 11 deletions

View File

@ -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"; };

View File

@ -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; })))

View File

@ -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