nixos/printing: add option to disable browsed daemon (#344702)
This commit is contained in:
commit
e04b941dfb
@ -9,7 +9,6 @@ let
|
||||
cfg = config.services.printing;
|
||||
cups = cfg.package;
|
||||
|
||||
avahiEnabled = config.services.avahi.enable;
|
||||
polkitEnabled = config.security.polkit.enable;
|
||||
|
||||
additionalBackends = pkgs.runCommand "additional-cups-backends" {
|
||||
@ -99,7 +98,7 @@ let
|
||||
cupsdFile
|
||||
(writeConf "client.conf" cfg.clientConf)
|
||||
(writeConf "snmp.conf" cfg.snmpConf)
|
||||
] ++ optional avahiEnabled browsedFile
|
||||
] ++ optional cfg.browsed.enable browsedFile
|
||||
++ cfg.drivers;
|
||||
pathsToLink = [ "/etc/cups" ];
|
||||
ignoreCollisions = true;
|
||||
@ -270,6 +269,15 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
browsed.enable = mkOption {
|
||||
type = types.bool;
|
||||
default = config.services.avahi.enable;
|
||||
defaultText = literalExpression "config.services.avahi.enable";
|
||||
description = ''
|
||||
Whether to enable the CUPS Remote Printer Discovery (browsed) daemon.
|
||||
'';
|
||||
};
|
||||
|
||||
browsedConf = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
@ -419,7 +427,7 @@ in
|
||||
serviceConfig.PrivateTmp = true;
|
||||
};
|
||||
|
||||
systemd.services.cups-browsed = mkIf avahiEnabled
|
||||
systemd.services.cups-browsed = mkIf cfg.browsed.enable
|
||||
{ description = "CUPS Remote Printer Discovery";
|
||||
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
Loading…
Reference in New Issue
Block a user