anchor.diff:    ghcCabalDerivation = args : with args;
       let buildInputs =  (if (args ? buildInputs) then args.buildInputs else [])
                       ++ [ ghcPkgUtil ] ++ ( if args ? pass && args.pass ? buildInputs then args.pass.buildInputs else []);
  +        configure = if (args ? useLocalPkgDB) 
  +                      then "nix_ghc_pkg_tool join localDb\n" +
  +                            "\$CABAL_SETUP configure --package-db=localDb \$profiling \$cabalFlags"
  +                      else "\$CABAL_SETUP configure --by-env=\$PACKAGE_DB \$profiling \$cabalFlags";
       in stdenv.mkDerivation ({
         srcDir = if (args ? srcDir) then args.srcDir else ".";
         inherit (args) name src propagatedBuildInputs;
         phases = "unpackPhase patchPhase buildPhase";
         profiling = if getConfig [ "ghc68" "profiling" ] false then "-p" else "";
  +      cabalFlags = map lib.escapeShellArg 
  +                      (getConfig [ "cabal" "flags" ] []
  +                       ++ (if args ? cabalFlags then args.cabalFlags else []) );
         # TODO remove echo line
         buildPhase ="
             createEmptyPackageDatabaseAndSetupHook
  
positive.code:           ghc --make Setup.*hs -o setup
            CABAL_SETUP=./setup
  
            \$CABAL_SETUP configure --by-env=\$PACKAGE_DB \$profiling
            \$CABAL_SETUP build
            \$CABAL_SETUP copy --destdir=\$out
            \$CABAL_SETUP register --gen-script
  
negative.code:          name = deriv.name + "-src-with-tags";
           createTagFiles = [
                 { name = "${deriv.name}_haskell";
                   # tagCmd = "${toString ghcsAndLibs.ghc68.ghc}/bin/hasktags --ignore-close-implementation --ctags `find . -type f -name \"*.*hs\"`; sort tags > \$TAG_FILE"; }
                   tagCmd = "${toString hasktags}/bin/hasktags-modified --ignore-close-implementation --ctags `find . -type f -name \"*.*hs\"`; sort tags > \$TAG_FILE"; }
            ];
         };
      };
    };
  
    # this may change in the future
    ghc68extraLibs = (import ../misc/ghc68extraLibs ) {
      # lib like stuff
      inherit bleedingEdgeRepos fetchurl lib addHasktagsTaggingInfo ghcCabalDerivation pkgconfig unzip zlib;
      # used (non haskell) libraries (ffi etc)
      inherit postgresql mysql sqlite gtkLibs gnome xlibs freetype getConfig libpng bzip2 pcre;
  
      executables = ghc68executables;
      wxGTK = wxGTK26;
  