-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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/networkd: allow strings for addresses
#342307
base: master
Are you sure you want to change the base?
Conversation
The difference between `address` and `addresses` is that the former adds an `Address` key into the `[Network]` section whereas the latter creates its own `[Address]` section. However, these are effectively equivalent as far as systemd-networkd is concerned (from `systemd.network(5)`): This is a short-hand for an [Address] section only containing an Address key (see below). I think it's pretty awkward that you have to remember which one to use. This patch alters the type of `addresses` to allow both `[Address]`-config encoded as Nix attribute-set and strings that will be rendered to [Address] Address=... As a result, the `address` option is obsolete, so I decided to deprecate it.
@@ -2470,6 +2470,7 @@ let | |||
address = mkOption { | |||
default = [ ]; | |||
type = types.listOf types.str; | |||
apply = warn "`systemd.network.networks.\"${name}\".address` is deprecated, use `systemd.network.networks.\"${name}\".addresses` instead."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Went this route since mkRenamedOptionModule
seems broken for submodules: #96006
This still requires fixups of the existing usages, but I'd still like to get some feedback on that. |
Yes, I think |
Description of changes
address
yet. First I'd like to discuss ifaddress
or deprecate it.The difference between
address
andaddresses
is that the former adds anAddress
key into the[Network]
section whereas the latter creates its own[Address]
section. However, these are effectively equivalent as far as systemd-networkd is concerned (fromsystemd.network(5)
):I think it's pretty awkward that you have to remember which one to use.
This patch alters the type of
addresses
to allow both[Address]
-config encoded as Nix attribute-set and strings that will be rendered toAs a result, the
address
option is obsolete, so I decided to deprecate it.cc @NixOS/systemd @mweinelt
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.