You can create a task in your nimble file.
I do that in my config.nims file, but the same should work in your .nimble too.
Ref: https://github.com/kaushalmodi/nim_config/blob/ffdefa859b9b9837dcb8fe643f04a75e5f98089b/config.nims#L239-L247