eyJhb changed the topic of #nixos-on-your-router to: NixOS on your Router || https://logs.nix.samueldr.com/nixos-on-your-router
mmlb has joined #nixos-on-your-router
rb2k has quit [Ping timeout: 264 seconds]
eyJhb has joined #nixos-on-your-router
eyJhb has quit [Ping timeout: 240 seconds]
eyJhb has joined #nixos-on-your-router
betawaffle has quit [Ping timeout: 240 seconds]
betawaffle has joined #nixos-on-your-router
feepo has quit [Ping timeout: 242 seconds]
feepo has joined #nixos-on-your-router
eyJhb has quit [Ping timeout: 240 seconds]
eyJhb has joined #nixos-on-your-router
eyJhb has joined #nixos-on-your-router
LilleCarl has quit [Ping timeout: 256 seconds]
LilleCarl has joined #nixos-on-your-router
rnhmjoj has joined #nixos-on-your-router
qyliss has quit [Quit: bye]
qyliss has joined #nixos-on-your-router
<rnhmjoj> is there anyone here confident with systemd-networkd? we could use some help with this PR: #107382
<{^_^}> https://github.com/NixOS/nixpkgs/pull/107382 (by rnhmjoj, 8 weeks ago, open): nixos/{networkd,dhcpcd}: remove udev-settle hack
<qyliss> if you don't find anybody here you could try in #nixos-systemd
<rnhmjoj> thanks, there are really a lot of nixos channels...
<hexa-> so, this is a udev issue really
<hexa-> if it works with predictable names
<hexa-> and it still works after renaming interface names
<hexa-> that should cover most of everything?
<hexa-> you tried renaming here (https://github.com/NixOS/nixpkgs/pull/107382#issuecomment-757197988) and it didn't seem to work
<hexa-> what's the state of thtat?
<hexa-> oh, you asked for help
<hexa-> rnhmjoj: you cannot rename network interfaces that are already up, maybe that is the issue
<rnhmjoj> uhm, it could explain the "device or resource busy" error
<hexa-> udev probably isn't finished before networkd starts
<hexa-> which would be very odd
<hexa-> useNetworkd = networkd;
<hexa-> what is `networkd`?
<rnhmjoj> oh, it's just a switch to turn it on/off in the nixos networking test
<hexa-> anyway, in a networkd scenario link renaming would happen with a .link file
<hexa-> untested, but this would be the networkd/udev way to rename interfaces
<rnhmjoj> thank you, i'll it
<rnhmjoj> *try it
<hexa-> but if renaming via udev rules doesn't work, that sounds like networkd starts too early
<hexa-> flokli might have insight here :)
<rnhmjoj> the link file does not appear to work, with or without networkd. not even on nixpks master
<hexa-> hm
<rnhmjoj> i just tested again the udev rule and that works, although it breaks with networkd after my change
<flokli> check networkctl status $iface what .link matches?
<rnhmjoj> the generated .link file is identical to that example, the only difference is the 10- prefix: i'm trying this now
<rnhmjoj> ok, it works on master
<hexa-> flokli: but this still seems to break udev renaming, any idea?
<hexa-> I mean, this drops udev-settle, so networkd starts earlier
<hexa-> just too early
<rnhmjoj> ...and it breaks with my change, so using a .link or udev makes no difference here
<hexa-> yeah, both should work honestly
<hexa-> both are handled by udev
<flokli> I'm lacking some context I think
<flokli> but yes, the .link files are matched by udev, pretty early in boot
<flokli> however, you can use networkctl (or poke at the logs) to see which one was picked up
<rnhmjoj> i don't understand why networkd would enter this kind of race condition. it certainly does not require udev-settle on other distro, does nixos patches it somehow?
<flokli> rnhmjoj: wait wait
<rnhmjoj> (i'll try running the test interactively)
<flokli> so I think the problem here is that something brings the network interface up
<flokli> and we have the .link file too late
<flokli> so udev can't rename it anymore
<rnhmjoj> yes, probably, that's what's hexa- suggested
<flokli> rnhmjoj: so the problem you're currently talking about is https://github.com/NixOS/nixpkgs/pull/107382#issuecomment-757197988 ?
<hexa-> yes
<flokli> the udev rules are not copied in the initrd
<flokli> but something brings up the network interfaces too early
<flokli> we'd need to copy udev.extraRules into the initrd too
<flokli> but that could cause too much stuff to be pulled in
<flokli> so udev in initrd renames it, and we bring them up later
<rnhmjoj> flokli: yeah, the "device or resource busy" error
<flokli> yes
<flokli> rnhmjoj: so I'd propose trying to see if it works if we copy udev rules into the initrd
<rnhmjoj> this is interesting: i tried as you suggested to see what is the final ifname with networkctl
<rnhmjoj> it's left intact: eth0, because in nixos vms usePredictableInterfaceNames is false
<flokli> ugh
<rnhmjoj> if i force it on (needs lib.mkOverride 0), then the interface is actually renamed
<flokli> yeah, the whole test driver networking stuff is another tire fire
<flokli> -> #nixos-python-test-driver
<rnhmjoj> i'll have to try on a real machine, but it looks like `usePredictableInterfaceNames = false` interferes with the custom renaming, somehow
<rnhmjoj> uhm, all the option does is setting net.ifnames=0, i think i'll take a look at the udev source
<rnhmjoj> (btw, i figued net.ifnames is not a real kernel parameter but a systemd-udev thing)
<flokli> yes, it's read there
Shados has quit [Quit: Shados]
Shados has joined #nixos-on-your-router
chrisaw has joined #nixos-on-your-router
<rnhmjoj> it looks like it's not a networkd issue, or an issue if net.ifnames=0: i managed to reproduce it with dhcpcd and net.ifnames=1
rb2k has joined #nixos-on-your-router
<rnhmjoj> it's just that udev takes too long to rename the interfaces
<rnhmjoj> i see no other way than to move all .link/rules to stage 1
<flokli> rnhmjoj: sounds like a plan to me
<flokli> I hope we can somehow distinguish "extraRules renaming interfaces" from other stuff
<flokli> I'm afraid some modules might interpolate some nix paths in there, and blow up initramfs size
<rnhmjoj> uhm, we could advise to use netword.links to change interface settings, given they work even outside networkd
<rnhmjoj> or maybe create service.udev.initrdRules
<flokli> yeah, providing some more examples on how to use .link for renaming, and providing udev.initrdRules as an escape hatch might be better than just adding all udev rules
<flokli> if we have more release notes assisting people to update their configs
<rnhmjoj> links are probably a better idea because they are interfaces-specific and structured, unlike extraRules
<flokli> I agree
<flokli> but then people come and say like "these rules worked all the time, why do I need to systemd-ify them?"
<flokli> problem is, udev.extraRules currently contains such a "rename network interfaces" example
<rnhmjoj> well, we could do both: it's not much more code. an initrdRules option could also be used for other purposes, besides networking
<flokli> ack
rb2k has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rb2k has joined #nixos-on-your-router
aleph- has joined #nixos-on-your-router
teozkr_ has quit [Remote host closed the connection]
teozkr_ has joined #nixos-on-your-router
rb2k has quit [Quit: Textual IRC Client: www.textualapp.com]
teozkr_ has quit [Remote host closed the connection]
<rnhmjoj> flokli: i pushed new commits that implements all of that, plus documentation and release notes
teozkr_ has joined #nixos-on-your-router
<flokli> Woow, nice!
<flokli> Will take a look in a bit, thanks :-)
<rnhmjoj> thank you, it could use another set of eyes
<flokli> rnhmjoj: some comments, mostly nits on the docs to make them clearer to understand
<rnhmjoj> i'm on it