forked from mirrors/nixpkgs
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:
parent
f677cbabe9
commit
6c563f30fe
|
@ -195,8 +195,8 @@ let
|
||||||
};
|
};
|
||||||
}; # end of configfile derivation
|
}; # end of configfile derivation
|
||||||
|
|
||||||
kernel = (callPackage ./manual-config.nix { inherit buildPackages; }) (basicArgs // {
|
kernel = (callPackage ./manual-config.nix { inherit lib stdenv buildPackages; }) (basicArgs // {
|
||||||
inherit kernelPatches randstructSeed lib stdenv extraMakeFlags extraMeta configfile;
|
inherit kernelPatches randstructSeed extraMakeFlags extraMeta configfile;
|
||||||
pos = builtins.unsafeGetAttrPos "version" args;
|
pos = builtins.unsafeGetAttrPos "version" args;
|
||||||
|
|
||||||
config = { CONFIG_MODULES = "y"; CONFIG_FW_LOADER = "m"; };
|
config = { CONFIG_MODULES = "y"; CONFIG_FW_LOADER = "m"; };
|
||||||
|
|
|
@ -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
|
, libelf, cpio, elfutils, zstd, python3Minimal, zlib, pahole
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
lib_ = lib;
|
||||||
|
stdenv_ = stdenv;
|
||||||
|
|
||||||
readConfig = configfile: import (runCommand "config.nix" {} ''
|
readConfig = configfile: import (runCommand "config.nix" {} ''
|
||||||
echo "{" > "$out"
|
echo "{" > "$out"
|
||||||
while IFS='=' read key val; do
|
while IFS='=' read key val; do
|
||||||
|
@ -12,10 +15,7 @@ let
|
||||||
done < "${configfile}"
|
done < "${configfile}"
|
||||||
echo "}" >> $out
|
echo "}" >> $out
|
||||||
'').outPath;
|
'').outPath;
|
||||||
in {
|
in lib.makeOverridable ({
|
||||||
lib,
|
|
||||||
# Allow overriding stdenv on each buildLinux call
|
|
||||||
stdenv,
|
|
||||||
# The kernel version
|
# The kernel version
|
||||||
version,
|
version,
|
||||||
# Position of the Linux build expression
|
# Position of the Linux build expression
|
||||||
|
@ -48,7 +48,7 @@ in {
|
||||||
# Whether to utilize the controversial import-from-derivation feature to parse the config
|
# Whether to utilize the controversial import-from-derivation feature to parse the config
|
||||||
allowImportFromDerivation ? false,
|
allowImportFromDerivation ? false,
|
||||||
# ignored
|
# ignored
|
||||||
features ? null,
|
features ? null, lib ? lib_, stdenv ? stdenv_,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
@ -387,4 +387,4 @@ stdenv.mkDerivation ((drvAttrs config stdenv.hostPlatform.linux-kernel kernelPat
|
||||||
++ extraMakeFlags;
|
++ extraMakeFlags;
|
||||||
|
|
||||||
karch = stdenv.hostPlatform.linuxArch;
|
karch = stdenv.hostPlatform.linuxArch;
|
||||||
} // (optionalAttrs (pos != null) { inherit pos; }))
|
} // (optionalAttrs (pos != null) { inherit pos; })))
|
||||||
|
|
|
@ -593,11 +593,11 @@ in {
|
||||||
linux_hardkernel_latest = packages.hardkernel_4_14;
|
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 }:
|
customPackage = { version, src, modDirVersion ? lib.versions.pad 3 version, configfile, allowImportFromDerivation ? true }:
|
||||||
recurseIntoAttrs (packagesFor (manualConfig {
|
recurseIntoAttrs (packagesFor (manualConfig {
|
||||||
inherit version src modDirVersion configfile lib stdenv allowImportFromDerivation;
|
inherit version src modDirVersion configfile allowImportFromDerivation;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
# Derive one of the default .config files
|
# Derive one of the default .config files
|
||||||
|
|
Loading…
Reference in a new issue