In short, this is already in game.
If you build a habitat over a 3 gas deposit, the habitat can build 3 gas extractor buildings, each of which produces 3 gas (so 9).
Now, the problem is that a gas miner is 3 gas, while a gas refiner is 3 gas for 10 minerals. So all you are really saving is 10 minerals.
The habitat, at 150 influence and 1500 alloys and 25 empire size, saves you a whole 45 minerals per month. Which isn't nothing, but it isn't great either.
Now, there is no equivalent for dark matter and zro.
Sorta. A refinery habitat vs. a strategic mining habitat saves 11.5 minerals (+20% upkeep from capital, -5% from Prosperity), saves 2 energy in building upkeep (1 vs 3), and gives another 1 crystal/motes/gas from Mining Subsidies (assuming you're running it) per pop.
Irritatingly, you can't actually use the strategic resource gatherer designation unless you're void dwellers and get lucky with orbital surveying, so you'll miss out on 10% output (or 20%, with the GC resolution), while the refinery habitat is getting 10%. If you've got any worker output modifiers (authoritarian, Extended Shifts, Very Strong, etc.) you can make that up, but if you have specialist modifiers (Prosperity, egalitarian), it will go the other way even more.
So it's around +0.5-1.0 gas, +11.5 minerals, +2 energy per pop for a gatherer hab vs. a refinery hab. And you can use the leisure station designation to get +10% happiness (which might help, a bit, but probably not). But you're also sacrificing the base output of the deposit, plus all the mining station modifiers, which should be +50%. So the baseline is losing 1.5 gas per pop.
All in all: -0.5 to -1.0 gas per pop, in order to save 11.5 minerals and 2 energy. Better to just have a refinery habitat, and get more total gas output.
Don't build habitats over strategic resource deposits unless you have absurd worker output, somehow. Like, Fanatic Authoritarian, chattel slavery, Very Strong, Nerve Stapled, whatever the overtuned "very strong" is, Extended Shifts, etc. all stacked on top of each other. Even then, don't build them unless you were already considering building a refinery habitat just for the extra building slots.
Interestingly, Dark Matter, Zro, and Nanites do actually benefit from having a habitat. The mining stations don't benefit from mining station bonuses, for some reason, when the deposit is on a habitat, they do. So if you really want more Nanites or Zro, you should build a habitat. Then use the habitat for whatever. I'm not sure about living metal; I suspect it's the same, but as it only spawns through anomalies, I can't test it.