nixos/systemd-resolved: add mDNS support option, open firewall #383973
+91
−26
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Based on #211169, this PR does three things:
services.resolved.mdns
option with sub-options to configure mDNS in systemd-resolved.services.resolved.llmnr
so that it supports the same sub-options as mDNS.For
services.resolved.llmnr
, the old enum-based value was retained but considered deprecated. I don't know if it's possible to mark use of this as explicitly deprecated, so I usedtypes.either
. This way, previous user configurations will at least continue working.For the firewall port, I opted to make the default to open it. This follows the example of
services.avahi.openFirewall
, which is also enabled by default, and also makes general sense because most people will want this port open if they are going to use the service (otherwise it doesn't work). However, if a user's config specifies an old enum value instead of the new sub-options, then the firewall is not opened, which preserves the old behaviour to a degree.To preserve backwards compatibility, I made both mDNS and LLMNR enabled by default. That is the default configuration for systemd-resolved, and in the case of mDNS that was therefore used for all previous configurations. However, I personally think that it is better for these two settings to be opt-in, so that the user is not "surprised" by services they didn't explicitly ask for. I can make them opt-in by default, but that would be a larger breaking change.
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.