I'm working on a headless IoT device that creates its own access point so that the user can access its web UI and do necessary configuration. The system uses networkd but I'm not very attached to it and may change to NetworkManager if it's better for my use-case.
My question is: how do I elegantly (not by manually replacing config files for networkd and wpa_supplicant) change from exposing the access point to connecting to a configured network? For wpa_supplicant this looks easy - I can control it over dbus from the same process that serves the web UI but networkd doesn't have a dbus API and I frankly don't know how to switch from a fixed IP for the wlan interface to DHCP without modifying the network file.
Should I just give up and use NetworkManager?