Add pre- and post-build hooks to all layers