NixOS: add setting services.printing.enableAutoDiscovery

main
Felix Stupp 1 year ago
parent 5c2e2813d0
commit 31b704802a
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -2,5 +2,6 @@
imports = [
# files
./podman.nix
./printing.nix
];
}

@ -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…
Cancel
Save