Content Warning

@fluffgar agreed.

Yes, NASA has looked into closed ecological life support system, using tanks of algae. Miniature examples of farming.

The algae eat astronaut urine, feces, carbon dioxide exhalation, plus sunlight. The astronauts eat algae, drink purified water, and inhale oxygen.