Skip to content

fix(nix): use services.avahi.settings when nixpkgs has it - #329

Merged
zackb merged 1 commit into
zackb:mainfrom
SW-philip:fix/avahi-settings
Nov 18, 2026
Merged

zackb merged 1 commit into
zackb:mainfrom
SW-philip:fix/avahi-settings

Conversation

@SW-philip

Copy link
Copy Markdown
Contributor

On current nixos-unstable, enabling programs.tether.wifi prints two evaluation warnings:

The option `services.avahi.publish.enable` is obsolete. Use
`services.avahi.settings.publish."disable-publishing" = false;` instead.
The option `services.avahi.publish.userServices` is obsolete. Use
`services.avahi.settings.publish.disable-user-service-publishing = false;`
and `services.avahi.settings.publish.publish-addresses = true;` instead.

nixos-26.05 (and the nixpkgs this flake pins) doesn't have services.avahi.settings yet, so switching to the new names outright would break those. The module now checks options.services.avahi ? settings and sets whichever form exists.

Tested by evaluating the module with wifi.enable = true against three nixpkgs revisions and comparing avahi-daemon's ExecStart (which embeds the generated config's store path) before and after:

nixpkgs config file avahi warnings
flake pin (83199d0, no settings) identical 0 → 0
nixos-unstable (d4f25a3) identical 2 → 0
nixos-26.05 (ac588ef, no settings) identical 0 → 0

checks.x86_64-linux.module passes. (Its first run failed in the package's HeadlessRuntime.ExplicitStderrLoggingDoesNotCreateALogFile test and passed on retry, so that test looks flaky; this change doesn't affect the package derivation.)

nixpkgs-unstable replaced services.avahi.publish.{enable,userServices}
with a freeform services.avahi.settings and warns on the old names.
Set the equivalent settings.publish keys when the option exists and
keep the old ones for releases without it (nixos-26.05, the flake's
own pin), so the generated avahi-daemon.conf is unchanged on both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@zackb
zackb merged commit a4b317f into zackb:main Nov 18, 2026
@zackb

zackb commented Nov 18, 2026

Copy link
Copy Markdown
Owner

Appreciate the help with nix

@SW-philip
SW-philip deleted the fix/avahi-settings branch November 18, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants