@paul @pdenya I've encountered a similar use-case when loading environment variables, validating them and exposing the result to the rest of the application.
Here's how I go about doing it, using Zod for parsing and transforming, and crashing early with helpful messages if something isn't right.
https://github.com/SocialGouv/e2esdk/blob/beta/packages/server/src/env.ts
Though the resulting env object is exported/imported rather than passed as arguments, in Fastify I could expose it as a server property and use that as dependency injection.