I tried to read the Nixpkg documentation several times on the subject.
I can’t seem to grok its relevance.
I do understand that setup-hooks are not hermetic because they are run multiple times (each time the package is referenced) unless the script tries to be idempotent.