def snapshot_cache(check_exists):
    """Returns location of snapshot file"""
    from os import path, makedirs
    cache_directory = path.expanduser('~/.cache/nixml/')
    cache_file = cache_directory + 'snapshots.tsv'
    if check_exists and not path.exists(cache_file):
        return None
    makedirs(cache_directory, exist_ok=True)
    return cache_file
