Integrating Homebrew bash completion on Linux with system completions

I like to use Homebrew on my Linux development machine as well, instead of random apt packages which may or may not be up to date for common tools. One annoyance I found a solution for, is getting the bash completion for Homebrew commands to work on Linux. The problem is that Ubuntu (and other Linux distributions) have their own bash completion scripts for system commands. But the way most bash…