the following would IMO be the perfect solution, allowing stdlib/compiler/tools to use nimble packages, while not clashing with user installed packages
import std/strutils # stdlib
import stdx/regex # controlled via `nimble install regex` from compiler installation, using fixed hashes for all dependent pkgs
import pkg/regex # controlled via `nimble install regex` from user; stdx/regex and pkg/regex resolve as separate modules
import regex # same as pkg/regex
the rare case of exportc procs can be dealt with using a exportc prefix (eg "stdx") to avoid duplicate definition errors
the stdx prefix is not even essential, ie, std/regex could be used to, and modules could transparently be re-mapped to a separate nimble package without breaking user code nor interfering with user installed nimble packages (which could be a different version or same, irrelevant) ; neat.
links