Put the flour and butter in a food processor and whizz until the mixture looks like breadcrumbs. Add the sugar, egg yolks and rosemary and whizz to a dough.Tip onto a lightly floured work surface and knead in the walnuts. Shape into a log about 5cm across. Wrap in plastic and chill for an hour.
Heat the oven to 180c/fan 160/gas 4. Slice the dough into biscuits and arrange on a buttered baking sheet. Bake for 20 minutes then cool.