New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos: Provide overrideStrategy option for systemd-networkd units #310493
Comments
You can define a fresh unit that is higher up in the directory listing (i.e. has |
Yes, and also I would like to provide an option to override rather than replace systemd-networkd config files. It would make the network interface config for containers shorter and better able to cope with upstream changes. The option could potentially be useful for overriding (rather than replacing) any network configuration shipped with systemd upstream. At the moment though most upstream
Perhaps that used to be the case, but since at least systemd 255.4 it's possible and documented in the
Yes. Here is an example of a systemd network configured with a drop-in:
|
I would be happy to implement this myself, but would first like review from maintainers of the systemd NixOS modules (whoever they are). |
Describe the bug
I would like to configure a systemd network using an upstream
.network
unit with a single small modification.This can be achieved by creating a drop-in
.conf
file under/etc/systemd/network
.For systemd services, NixOS provides an
overrideStrategy
option. But there is no corresponding option forsystemd.network.{networks,links,netdevs}
.Steps To Reproduce
Currently, to configure a drop-in, we must do:
The upstream unit can be found at
/run/current-system/sw/lib/systemd/network/80-container-host0.network
.Expected behavior
It would be nicer to be able to configure the drop-in like this:
Possible values for
overrideStrategy
would be the same as forsystemd.services.<name>.overrideStrategy
, plus another option"replace"
. This would be the default value, describing the current behaviour where a network unit defined in NixOS will mask the upstream unit fromsystemd.packages
.Additional context
This is relevant to configuring systemd-networkd inside NixOS containers, because the container network interface name does not match upstream systemd.
Notify maintainers
cc: @Ma27 who has been working on networkd containers (NixOS/rfcs#108).
Metadata
Add a 👍 reaction to issues you find important.
The text was updated successfully, but these errors were encountered: