NixOS config conversion help

hello, I don’t have a great way to start this, I just need help converting some imperative code to something declarative for my NixOS config file.

ip route add local default dev lo table 100
ip rule add fwmark 1 lookup 100
ip -6 route add local default dev lo table 100
ip -6 rule add fwmark 1 lookup 100

this is the code, and i think that i can get line 1 and 3 by using networking.interfaces.lo.ipv(4/6).routes = {smth} although i’m not quite sure what that smth is going to be yet exactly, I’ll have to look at the syntax of that further. The rules, on the other hand, I don’t really know where to start. any help would be appreciated!

It seems that it can be declared as followed:
https://search.nixos.org/options?channel=24.05&from=0&size=50&sort=relevance&type=packages&query=ipv4.routes.

Some posts that may help: