anchor.diff:    inherit docPackages;
   
     buildPhase = ''
  -    ${lib.optionalString (nonNullPackages != [] -> docPackages == [])
  +    ${lib.optionalString (packages != [] -> docPackages == [])
          ("echo WARNING: localHoogle package list empty, even though"
          + " the following were specified: "
  -       + lib.concatMapStringsSep ", " (p: p.name) nonNullPackages)}
  +       + lib.concatMapStringsSep ", " (p: p.name) packages)}
       mkdir -p $out/share/doc/hoogle
   
       echo importing builtin packages
  
positive.code:     ${lib.concatMapStringsSep "\n" (el: ''
          ln -sfn ${el.haddockDir} "$out/share/doc/hoogle/${el.name}"
        '')
        (builtins.map (p: { haddockDir = if p ? haddockDir then p.haddockDir p else null;
                            name = p.pname; })
          docPackages)}
  
      echo building hoogle database
      hoogle generate --database $out/share/doc/hoogle/default.hoo --local=$out/share/doc/hoogle
  
negative.code:       This index includes documentation for many Haskell modules.
      '';
  
    # TODO: closePropagation is deprecated; replace
    docPackages = lib.closePropagation
      # we grab the doc outputs
      (map (lib.getOutput "doc") packages);
  
  in
  stdenv.mkDerivation {
  