The networking setup on my laptop has grown a bit hairy over time; Multiple VPNs, one of them routing the default route on a netns based Wireguard connection, IPv6 unique local address config for my home network.
Over the years I ran into more and more edge cases; Network config only properly activating after second run, no DHCP config after return from suspend, no IPv6 ULA when using netns, etc.
So I decided to give systemd-networkd a try. My goal was to experience fewer edge cases, and that seems to workout for me, but now I ran into new deficiencies. E.g. networkd doesn’t support network namespaces yet. And recently I learned again, that networkd state applications really aren’t idempotent, and even worse, it doesn’t clean up interfaces that got removed from the system config. At the same time I see the advantages of a unified networking “language” across lots of Linux distributions. And in the past weeks my pleasant experiences with systemd-networkd greatly overweighed the unpleasant ones.
So this leaves me with the question which kind of networking backend is feasible for NixOS in the long term. I recommend @fpletz’s great talk on NixCon 2018, in which he made a point to move to networkd. I very much agree with his argument that implementing a network stack is hard due to the loads of edge cases one has to fix and that it probably should happen in an upstream project like systemd, contraire to every distribution implementing their own.
At the same time I can’t help but notice some lack of drive regarding the move to networkd. The last change on
nixos/modules/tasks/network-interfaces-systemd.nix happened in april 2020, which was one of only two changes in 2020. The Tracking issue shows a similar level of activity. This makes me somewhat insecure off my feeling of enthusiasm regarding NixOS’s migration to networkd. Did I miss out on some important blockers, that make networkd unfeasible for large parts of the NixOS community? Or does the community currently lack the resources for a full migration, so that it would be better to stay with the scripted backend and give it a smoother polish? What’s going on?
In my free time I do a small amount of contributions to NixOS and I could see myself shifting my focus to networkd. But I notice some sense of a lack of direction with myself. Which mostly stems from the fact that I currently see so little activity from developers working on the migration. One example: I’m not sure wether it is actually desired to have every NixOS
networking.* option be implemented from both the scripted backend and networkd. It would make migration for users easier, as they could switch by flipping
networking.useNetworkd. But at the same time it would cause more code that needs to be maintained, which is undesirable in the long run, as we already have a full (much less leaky) abstraction over networkd in
systemd.network.*. This general lack of direction I experience here could be lessened, if I knew some more about your perspective on the topic.
So, tell me, NixOS contributors, what do you think? Are you using networkd and do you like it? Is the networkd backend something you are currently working towards? Do you think it should be the default in NixOS? Do you think the effort would profit from some kind of more formalised roadmap, e.g. in the form of an RFC? Looking forward to hear from you.
Edit: Just realised that my indicator for low activity wasn’t so good:
nixos/modules/system/boot/networkd.nix shows much more activity in 2020!