On a Mac, f.lux is not sufficiently strong, what has helped me a lot is to add a strong red color filter (System Preferences > Accessibility > Display > Color Filters > Filter Type: Color Tint, set to red, intensity to full). I do the same on my iPhone, it's quite comfortable during the night.
I also use the QuickShade app which makes the screen darker without reducing backligt brightness.