Preheat the oven to 180°C/350°F/gas 4. Grease a 23cm square x 4cm deep cake tin.
Blitz the digestives and the walnuts or almonds in a food processor.
Tip in the cocoa powder and sugar into the mix and blitz again until mixed and then transfer the mixture to a large bowl.
Mix in the coconut. Stir in the melted butter, then add the eggs and beat until well combined.
Press mixture into the tin and level with the back of a spoon.
Bake for 10-15 minutes, and then take out of the oven.
Place in the fridge to cool until ready to use.
Using a hand-held electric whisk, mix the butter for the custard-cream filling in a large bowl until pale and fluffy.
Mix in the custard powder and the vanilla extract, and then whisk in the icing sugar.
Once the mixture has a crumb-like consistency, add the milk and keep whisking until you have a pale filling with a mousse-like consistency.
Take the biscuit base out of the fridge and spread the custard filling over it.
Place back in the fridge to chill for an hour until set.
For the top layer, break up the chocolate and melt together with the butter in a bowl set over a pan containing a little simmering water.
Take the bowl off the heat and whisk in 1-2 teaspoons of water until the mixture is smooth and glossy. Pour the chocolate over the set custard and swirl with a spoon.
Cover the tin with cling film and place back in the fridge for several hours.
Cut into bars or bite size treats.