Creating environment variable from JSON file
You could write some PHP at the top of your general.php file that reads the JSON manifest in your public root directory, and add its keys/values to the config array. I wouldn't use environment variables here, personally – just add the manifest to the returned array in general.php: 

// In general.php:

$assetsManifest = @json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'].'/assets/assets.json')) ?: [];

return array(
    '*' =&gt; array(
        ...
        'assets' =&gt; (array)$assetsManifest,
    ),
);


...and in your template:

&lt;script src="{{ craft.config.assets['main.js'] ?? 'main.js' }}"&gt;&lt;/script&gt;


Be advised that the null-coalescing operator (??) was just added in Craft 2.6 – if you haven't updated yet, you can use the default filter instead:

&lt;script src="{{ craft.config.assets['main.js']|default('main.js') }}"&gt;&lt;/script&gt;


Another approach for getting revved asset filenames in templates, is to use a plugin which adds either a custom template variable method or Twig filter/function to Craft. For an example of the latter, see Viget Labs' Gulp Rev Craft plugin, which is bundled with their awesome Gulp Starter repo. Here's how revving works using this particular plugin:

&lt;script src="{{ 'main.js'|gulp_rev }}"&gt;&lt;/script&gt;


For me, individual asset filenames in the config feels a bit off and the custom filter option seems a lot cleaner, so I'm personally going with that approach.