Nontrivial topological flat bands in a diamond-octagon lattice geometry