He is playing the part of a curator of an exhibition of Vincent van Gogh. It is episode 10 in Series 31, written by Richard Curtis (The Black Adder, Mr. Bean).
Digital Spy reports that a 'set insider' told them, "It was a real coup to get Bill Nighy in Doctor Who, especially in Richard Curtis's amazing episode. Bill plays a van Gogh expert with some similar fashion choices to The Doctor himself."
It is said that this story is to take place in 19th century France as well as present day.