Much like mental illness. Your depression doesn't stop you from working out or going for a walk, but it might make it really really hard to start. You can use that as an excuse and never start or you can acknowledge this is why you never want to start. You just have to do it, or rely on someone to get you to do it like a good friend or partner.
If you let depression stop you from walking you'll never walk and get the benefits from it which could help you beat or mitigate depression. Maybe after 2 years of daily walks you won't be depression free, but its almost guaranteed you'll be doing better.