Preheat the oven to 200ºC/400ºF/gas mark 6 and line a 450g (approx. 20 x 10 cm) loaf tin with baking paper.
Heat a little olive oil in a frying pan over a medium heat. Peel and finely dice the onion, then fry for 10 minutes, until softened, stirring frequently.
Meanwhile, add the apricots to a food processor along with 100ml of cold water and process until it forms a smooth paste. Add the nuts and pulse until they have mostly broken down. Drain and rinse the lentils, then add to the food processor and pulse everything again until the mixture holds together. Transfer the mixture to a large mixing bowl.
Pull the rosemary leaves off the stalks, chop the leaves (you should be left with roughly 2 tablespoons) and add them to the mixing bowl along with the fried onions, ½ teaspoon of salt and ½ teaspoon of pepper, then mix everything together.
Transfer the mixture to the prepared loaf tin, pushing it down into the tin as you go, so it’s compact and level. Bake in the oven for 45 minutes, until golden brown.
Remove from the oven and leave the nut roast to stand in the tin for 5 minutes, before turning it out onto a wooden board. Serve in slices.