!tCyGickeVqkHsYjWnh:nixos.org

NixOS Networking

900 Members
on your Router! Declaratively manage your switching, routing, wireless, tunneling and more.262 Servers

Load older messages


SenderMessageTime
28 Jul 2025
@emilazy:matrix.orgemily (I guess, mostly I dislike networking.useDHCP being on by default) 20:28:21
@emilazy:matrix.orgemilyassertion is still good to have as a backstop20:28:31
@marcel:envs.netMarcel
In reply to @emilazy:matrix.org
assertion is still good to have as a backstop
i've also done them for networkd and all the others
20:28:46
@emilazy:matrix.orgemily networking.useNetworkd will likely be on by default as well soon, FWIW 20:29:10
@emilazy:matrix.orgemilythough it should be harmless if no interfaces are defined etc.20:29:16
@emilazy:matrix.orgemily I think systemd-networkd will ignore everything that isn't explicitly configured 20:29:28
@emilazy:matrix.orgemily networking.useDHCP and networking.networkmanager.enable are a bit different in that they look at "everything" 20:29:53
@emilazy:matrix.orgemilyshouldn't need to assert against networkd itself20:30:04
@marcel:envs.netMarcel https://github.com/MarcelCoding/nixpkgs/blob/ifstate/nixos/modules/services/networking/ifstate.nix#L115-L126
The problem is how do I enshure the user does not configure stuff in networkd?
20:30:47
@emilazy:matrix.orgemilyis it the end of the world if they do?20:31:05
@emilazy:matrix.orgemilyyou could imagine having a base networkd config used on all devices to get a basic uplink but then you have some fancy stuff using ifstate. dunno :)20:31:20
@emilazy:matrix.orgemilylike, you can also have both networkd and NM enabled, and it is fine as long as you do not try to configure the same interface with both20:31:43
@marcel:envs.netMarcelthey wonder why the changes do not apply and get overriden by ifstate, maybe even depeing on the order and between ifstate and networkd it could bing randomness demending which is faster20:31:49
@marcel:envs.netMarcelifstate is nice, because it deconfigures everything not defined20:32:07
@marcel:envs.netMarcelits truly declarative20:32:13
@emilazy:matrix.orgemily
## ignore settings to ignore existing interface, ip addresses, … (optional)
# ignore: …
20:32:20
@emilazy:matrix.orgemilyit looks like you can explicitly tell ifstate to ignore stuff you don't want it to manage20:32:28
@marcel:envs.netMarcelexcept for the ignore part20:32:30
@emilazy:matrix.orgemilyI think it is okay not to try and guard against everything as long as the obvious things are covered20:32:49
@marcel:envs.netMarcelstuff like docker or libvirt managed interfaces should be there20:32:52
@emilazy:matrix.orgemilypeople can always run … some other random software that tries to tweak networking config :)20:32:55
@emilazy:matrix.orgemilyand run into issues like that20:33:01
@emilazy:matrix.orgemily I would just assert on useDHCP and NetworkManager 20:33:13
@marcel:envs.netMarcelok20:33:18
@emilazy:matrix.orgemily you could get fancy with config.systemd.network.{networks,netdevs,links} but I think it is not worth it 20:33:55
@marcel:envs.netMarcelbut to do it corrently i also had to interpret the ignore section of ifstate20:34:21
@marcel:envs.netMarcel * 20:34:31
@emilazy:matrix.orgemilylike20:36:15
@emilazy:matrix.orgemily you are also not asserting on networking.interfaces.* 20:36:25
@emilazy:matrix.orgemily which can make scripted networking try to control things, even if useDHCP is off 20:36:30

Show newer messages


Back to Room ListRoom Version: 6