NixOS: add setting services.printing.enableAutoDiscovery
parent
5c2e2813d0
commit
31b704802a
@ -0,0 +1,25 @@
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.services.printing;
|
||||
in
|
||||
{
|
||||
|
||||
options.services.printing = {
|
||||
enableAutoDiscovery = lib.mkEnableOption ''
|
||||
CUPS automatic discovery of printers.
|
||||
|
||||
This will enable & configure Avahi accordingly,
|
||||
including opening ports in the firewall'';
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
# TODO make also possible with systemd-resolved
|
||||
services.avahi = lib.mkIf cfg.enableAutoDiscovery {
|
||||
enable = true;
|
||||
nssmdns4 = true;
|
||||
nssmdns6 = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue