From 6771dd826f2dde68d205d4c17a1facedd9d574be Mon Sep 17 00:00:00 2001 From: Antoine Viallon Date: Fri, 25 Mar 2022 02:49:43 +0100 Subject: [PATCH] [Services] Avahi: improve quality of life (especially with printer sharing and auto-detection) Signed-off-by: Antoine Viallon --- services.nix | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/services.nix b/services.nix index 3bdc018..642cf12 100644 --- a/services.nix +++ b/services.nix @@ -3,6 +3,7 @@ with lib; let cfg = config.aviallon.services; desktopCfg = config.aviallon.desktop; + laptopCfg = config.aviallon.laptop; generalCfg = config.aviallon.general; journaldConfigValue = value: @@ -85,7 +86,7 @@ in { # cups-kyocera-ecosys-m552x-p502x canon-cups-ufr2 ]; - webInterface = mkDefault false; + webInterface = mkDefault true; }; hardware.sane = mkIf desktopCfg.enable { @@ -183,10 +184,20 @@ in { # SmartCards services.pcscd.enable = true; - services.avahi.enable = true; # .lan/.local resolution - services.avahi.nssmdns = true; # .lan/.local resolution - services.avahi.publish.enable = true; - services.avahi.publish.hinfo = true; # Whether to register a mDNS HINFO record which contains information about the local operating system and CPU. + services.avahi = { + enable = true; # .lan/.local resolution + nssmdns = true; # .lan/.local resolution + openFirewall = true; + reflector = true; + publish = { + enable = true; + domain = true; + userServices = true; + addresses = true; + workstation = mkDefault (desktopCfg.enable && !laptopCfg.enable); + hinfo = true; # Whether to register a mDNS HINFO record which contains information about the local operating system and CPU. + }; + }; services.nginx = {