                 fullName = \"#{escapeNixString fullName}\";
                 hash = \"#{escapeNixString pkg.hash.toString 'hex'}\";
                 patchLatest = #{if pkg.patchLatest then 'true' else 'false'};
+                topLevel = #{if fullName of fullNames then 'true' else 'false'};
                 dependencies = [
           """
           for nm, rng of pkg.dependencies

      console.error "Each package must have a name, but #{JSON.stringify pkg} doesn't"
      process.exit 5
    range = pkg.range ? "*"
    generatePackage pkg.name, range, generateCallback


escapeNixString = (string) ->
  string.replace /(\\|\$\{|")/g, "\\$&"

fullNames = {}

fs.readFile file, (err, json) ->
  if err?
