When I bought my house it came with a loft that was only accessible by a ladder. There was no power up there and hence no light.
I wanted something that could be plugged in downstairs but also hung from a nail in one of the rafters. My first thought was an inspection lamp but when I looked at the price of those, I thought they were quite expensive for what they were. Most of the modern lamps were also panels giving very directional light which was not what I needed.
So I bought myself a cheap bulkhead lamp housing and added a strain relief socket and a small hook attached via an L bracket. The hook was salvaged from an old kitchen utensil rack.
Just reviewing the design this year when I was changing the bulb, I realised that the nut and bolt for the hook should really be earthed as it connects the inside to the outside. Alternatively a plastic bolt should also work.