anchor.diff:    # Any patches
     patches ? [],
     # The kernel .config file
  -  config,
  -  # Manually specified features the kernel supports
  +  configfile,
  +  # Manually specified nixexpr representing the config
     # If unspecified, this will be autodetected from the .config
  -  features ? optionalAttrs allowImportFromDerivation (readFeatures config),
  +  config ? optionalAttrs allowImportFromDerivation (readConfig configfile),
     # Whether to utilize the controversial import-from-derivation feature to parse the config
     allowImportFromDerivation ? false
   }:
   
   let
  -  commonMakeFlags = [
  -    "O=../build"
  -    "INSTALL_PATH=$(out)"
  -    "INSTALLKERNEL=${installkernel}"
  -  ];
  -
     installkernel = writeTextFile { name = "installkernel"; executable=true; text = ''
       #!/bin/sh
       mkdir $4
       mv -v $2 $4
       mv -v $3 $4
     '';};
  +
  +  isModular = config.isYes "MODULES";
  +
  +  installsFirmware = (config.isEnabled "FW_LOADER") &&
  +    (isModular || (config.isNo "FIRMWARE_IN_KERNEL"));
   in
   
  -stdenv.mkDerivation ({
  +stdenv.mkDerivation {
     name = "linux-${version}";
   
     enableParallelBuilding = true;
   
     passthru = {
  -    inherit version modDirVersion features;
  +    inherit version modDirVersion config;
     };
   
     inherit patches src;
  
positive.code:     runHook preConfigure
      mkdir ../build
      make $makeFlags "''${makeFlagsArray[@]}" mrproper
      ln -sv ${config} ../build/.config
      make $makeFlags "''${makeFlagsArray[@]}" oldconfig
      rm ../build/.config.old
      runHook postConfigure
    '';
  
    buildNativeInputs = [ perl nettools kmod ];
  
    makeFlags = commonMakeFlags;
  
    meta = {
      description = "The Linux kernel";
  
negative.code:     ];
      platforms = lib.platforms.linux;
    };
  }
  