I've purchased my Nexus 5x just a couple of months ago. Since it's a two-year-old model, you can also get it for a fraction of a flagship model (~$200), and, well, since I've purchased it brand new, I still have a year of security updates + a warranty that lasts exactly that. And on top of that, pure vanilla Android experience + whatever Google comes up with in the meanwhile (for example, I have Google Fi, Pixel camera app, Android Oreo, fingerprint reader at the same spot as this $1000 phone).
Next year I might buy the Pixel (original, not 2). My point is, if that I continue with what I've started this year, I'll upgrade to the next two-year-old Google phone, receive the latest and greatest features (that non-Google-made flagship models still don't have at the time) and I'll receive upgrades constantly.