query
On this page

linuxConfig

pkgs.linuxConfig

Docs pulled from | This Revision | about 1 hour ago


Derive one of the default .config files


Noogle detected

Implementation

The following is the current implementation of this function.

linuxConfig =
    {
      src,
      kernelPatches ? [ ],
      version ? (builtins.parseDrvName src.name).version,
      makeTarget ? "defconfig",
      name ? "kernel.config",
    }:
    stdenvNoCC.mkDerivation {
      inherit name src;
      depsBuildBuild = [
        buildPackages.stdenv.cc
      ]
      ++ lib.optionals (lib.versionAtLeast version "4.16") [
        buildPackages.bison
        buildPackages.flex
      ];
      patches = map (p: p.patch) kernelPatches; # Patches may include new configs.
      postPatch = ''
        patchShebangs scripts/
      '';
      buildPhase = ''
        set -x
        make \
          ARCH=${stdenv.hostPlatform.linuxArch} \
          HOSTCC=${buildPackages.stdenv.cc.targetPrefix}gcc \
          ${makeTarget}
      '';
      installPhase = ''
        cp .config $out
      '';
    };