Champions Shamrock Rovers move to within a point of league leaders Derry City after their 1-0 win at home to Dundalk.