Files
nix-config/modules/nixos/base/networking/mdns.nix
T
ryan4yin | 二花 e8e9691f2d chore(nix): update nixpkgs to e62746b and refresh flake inputs (#488)
* chore(nix): update nixpkgs to e62746b and fix 26.11 breakage

Bump nixpkgs to e62746b and preservation to 00be7f7, then adapt to the removals and renamed options in the new revision: drop the removed boot.initrd.systemd.enable settings, trim the stale emSign CA blacklist on Linux while keeping it for the older Darwin input, and migrate Avahi publishing to settings.publish. Work around sunshine still setting the legacy Avahi options and keep dsh-nu on its tested Nushell 0.115.1. Patch NUR dsh's pnpm call to pass nodejs = null, and update pyclipsync for the stdenv.hostPlatform.system rename.

* chore(nix): refresh flake inputs for 26.11

- update nixpkgs-darwin to the same e62746b revision as nixpkgs
- make dsh-nu follow main nixpkgs and patch its testedWith manifest for the resolved Nushell
- refresh floating inputs; update lanzaboote, tuios, and ponytail
- drop the nixpkgs-2505 and rust-overlay workarounds
- keep pyclipsync on main and simplify the cross-platform CA blacklist
- adopt home-manager's Nushell loadSessionVariables default

* fix(gitea): use ROOT_URL for nixpkgs 26.11

nixpkgs removed the legacy settings.server.DOMAIN option; the existing ROOT_URL already carries the public URL.

* chore(nix): update dsh-nu to 0.7.0

Assisted-by: DeepSeek Harness (deepseek-flash)
2026-10-30 00:39:01 +08:00

49 lines
1.4 KiB
Nix

{
lib,
config,
...
}:
let
cfg = config.modules.mdns;
in
{
options.modules.mdns.enable =
lib.mkEnableOption ''
mDNS/DNS-SD responder, backed by avahi: `<hostname>.local` access and CUPS
printer discovery.
On by default for physical hosts; MicroVM guests turn it off since they
have nothing to advertise.
''
// {
default = true;
};
config = lib.mkIf cfg.enable {
# Network discovery on a local network, mDNS
# With this enabled, you can access your machine at <hostname>.local
# it's more convenient than using the IP address.
# https://avahi.org/
services.avahi = {
enable = true;
nssmdns4 = true;
settings.publish = {
disable-publishing = false;
disable-user-service-publishing = false;
publish-addresses = true;
publish-domain = true;
};
# The nixpkgs sunshine module still sets these legacy options. Force them
# to null so settings.publish above is the only source of truth.
publish.enable = lib.mkForce null;
publish.userServices = lib.mkForce null;
};
# avahi and systemd-resolved both run an mDNS responder, which makes mDNS
# unreliable ("Detected another IPv4/IPv6 mDNS stack running on this host").
# Keep avahi (needed for DNS-SD, e.g. CUPS printer discovery) and turn off
# resolved's own mDNS.
services.resolved.settings.Resolve.MulticastDNS = false;
};
}