This is how I set up my homelab, step by step, in roughly the order I actually did it. Each step builds on the previous one. Read until you hit where you're at and stop.
The first thing to get right is flake.nix. This is your entire system config: users, networking, firewall, packages, services. Everything in one file.
Here's a minimal starting point. Set a static IP so your other devices can always find the server. Enable Docker and SSH. Disable sleep. That's it.