Business & farm

Health insurance premiums and HSA contributions go in Box 1.  Box 5 or whether or not they are deductible on your personal return does not change that.  They would go in Box 1 even if they were not deductible on your personal tax return.

For your personal tax return, no, HSA contributions are not dependent on Box 5 or Earned Income.