Append the contents of latest Stackage nightly build to the global cabal config file
The unappend_cabal_config can be more efficient and more elegant using a generator:


Reading all the lines from the file when you may only need the ones until one containing "Stackage" is wasteful
It's good to avoid the index variable in loops when possible


Like this:

def unappend_cabal_config():
    with open(cabal_config_path) as fh:
        for line in fh:
            if 'Stackage' in line:
                return
            yield line