Crypto Mining how to determine cost

When mining crypto as a hobby, there is a cost to electricity and a cost for the equipment used for mining, but there is no actual "purchase" cost since the mining generates the reward.  How do you determine a cost basis when you eventually sell the crypto you have mined?   

 

Example:  I used $5 in electricity plus the cost of equipment to mine $10 worth of crypto.  When I sell the $10 in crypto, how do I look at it from a gain/loss perspective, if I have held the crypto over 1 year (long term)