Making a ConfigProvider from a JSON file

Kinda lost at sea here. I'm just not grokking how to use ConfigProvider to read from a file. I have this little snippet:
const configProvider = Effect.gen(function*() {
  const fs = yield* FileSystem.FileSystem;
  const configFile = yield* fs.readFile("./config.json");
  return ConfigProvider.fromJson(configFile);
});
// returns Effect.Effect<ConfigProvider.ConfigProvider, PlatformError, FileSystem>

and the thought was to just use it in Layer.setConfigProvider() but that seems to want a plain ConfigProvider. Does this need to be a service if that's the case or is there a better way to do this?
Was this page helpful?