builtin/config: pull out function to handle config location