There are plenty of resources for survival and base management out there, but honestly my advice is that you don't need to worry about reinventing the wheel, because nobody has the wheel which fits your cart but you.
When introducing tertiary sub-systems, the fewer and simpler they are the better, over a full campaign it's not too bad to have them become complex but there is no sense in bloating your game with sub-systems you don't end up using, or using one set of survival rules that don't gel with your base rules.
If you make your own rules, they may be rough around the edges, but in a way that suits your table, and you'll be more equipped with chopping and changing them on the go to fit your groups needs.
That said, this hobby is built on us learning from eachother and celebrating our resources, so here are the resources I would suggest. I'm not going to recommend and paid resources here because I don't think you need them when you'll likely be using less than a quarter of the content in each.
For survival, the critical reason to look at resources is because it's poorly supported in 5e, and the reason it's poorly supported is because the exploration pillar doesn't function as strongly as the social and combat pillars.
Firstly we can look at survival for your party. I'm quite fond of the point crawl approach, which is more narrative and flexible than a hexcrawl but still sets up a reason not to skip travel, which is often what ruins survival. I'm choosing sly Flourish to link to because this article links to a further dozen articles about the subject.
The next obstacle is to look at the current mechanics in 5e that trivialise combat. The fact that you're looking for survival and settlements makes your wants perfect for the gritty realism optional rules, found on page 267 of the DMG. I'd probably alter this further and say a long rest is 3 days while adventuring away from the settlement and 24 hours when in the settlement. Plenty of spells trivialise survival too, such as goodberry, catnap and tiny hut. I can't recall the first place I hear this advice (it may have been via Zee Bashew on YouTube) but pick out the problem spells and have them require a costly material component that is difficult to obtain, which is consumed in the casting of the spell. Suddenly having that component becomes exciting. The conversation about resting here is vast and useful.
I'd replace exhaustion with the 2024 revised rules version, and I'd give it out reasonably liberally for characters who push themselves on their adventuring day. A character who gains a point from skipping a meal, marching too far and having a disease all at once feels the weight of them without also crippling the character entirely.
The other side of this coin is survival for your community. For this, I'd look no further than Ben Robbins' advice on the west marches. This is a ruleset really designed for drop in and out play that puts the responsibility on the players to choose their goals. Where I think you'll find this useful is how it's centered on a settlement that the party use as a base for their expeditions. Speaking of Ben Robbins, he set the bar for collaborative storytelling RPGs with microscope years ago, but the DNA of this game went on to inspire a game called The Quiet Year by Avery Alder. This would absolutely be my first point of thought for building a settlement survival mechanic. First I'd just play it as it is and experience how it works, then I'd lift the spirit into 5e as follows:
• Each session or in game week (whichever feels more natural, or pick something else if you think this is too fast or slow), a player pulls a card, on it are 1-2 prompts defining an unexpected event in the town, such as disease, a stranger arriving, or a resource being discovered, if you put 2 prompts in a card, the player chooses one.
• In addition, each session or in game week (again choose any scale you like here), the settlement votes on something that can be put forward by the players or a notable NPCs. I'd handle this as a council where each player character has 1 vote and there are twice as many additional votes from notable NPCs (i.e. 4 players and 8 NPCs so 12 votes). I'd simply roleplay this vote. If it's something obviously useful like diverting a river while having a water shortage, the vote may be a no brainer, but the party will need to clear the manticore from the path of the new river or whatever. However because this isn't locked in as a mechanical rule, story can emerge naturally. Perhaps the rogue and barbarian get into a brawl with the ealdorman's son and now he's pressuring members of the council to vote against your interest, perhaps your warlock develops a relationship with the brother of the person who votes on behalf of the laborers and she is more inclined to support your party's requests. As a DM, you'll also be getting information from the party as to what they want to handle.
• Each in game session or week, a grander part of the setting advances, perhaps a nearby kingdom becomes more totalitarian or winter approaches, whatever it is, the information is always heralded to the party, so they know the outside world is also progressing and also you can show any main plot you may have is also progressing.
My advice for what not to do for the settlement is this.
• Don't let the settlement be able to outright lose. It's one thing if the PCs die, but if the settlement is wiped out, there is nowhere to progress.
• Don't give the settlement decaying needs like food, warmth or happiness. Unlike a videogame where these can be addressed as mindless busywork, the party must consistently put time to this what may obstruct the story. Think of a film, if the water shortage is solved, it is solved until it's narrativly right for it to be disturbed, let the cards with prompts introduce this sort of conflict instead.
• The party need to be able to be the expedition team for the settlement, otherwise they have less of an inventive to leave. Somebody needs to scout the area and tackle nearby threats. I'm guilty of being a player in a game where we spent so many sessions not leaving the safe city that the DM had to narrativly destroy the city to get us exploring again.
• Don't overthink rules for settlement defenses and bonuses to player rolls. A pre-written guide on how palisades slow advancing goblins and the effective power of putting longbows in every able hand is probably no more useful than making it up as you go, and certainly takes more time. However if you enjoy making these rules, feel free to write anything that comes to mind, do what you find fun.
I really thought I'd be putting recommend resources here rTher than my own advice but I'm pretty happy with everything I've said here. I hope it's of use. I also wrote this on my phone in work so apologies for any typos.