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;
|
cfg = config.services.printing;
|
||||||
cups = cfg.package;
|
cups = cfg.package;
|
||||||
|
|
||||||
avahiEnabled = config.services.avahi.enable;
|
|
||||||
polkitEnabled = config.security.polkit.enable;
|
polkitEnabled = config.security.polkit.enable;
|
||||||
|
|
||||||
additionalBackends = pkgs.runCommand "additional-cups-backends" {
|
additionalBackends = pkgs.runCommand "additional-cups-backends" {
|
||||||
@ -99,7 +98,7 @@ let
|
|||||||
cupsdFile
|
cupsdFile
|
||||||
(writeConf "client.conf" cfg.clientConf)
|
(writeConf "client.conf" cfg.clientConf)
|
||||||
(writeConf "snmp.conf" cfg.snmpConf)
|
(writeConf "snmp.conf" cfg.snmpConf)
|
||||||
] ++ optional avahiEnabled browsedFile
|
] ++ optional cfg.browsed.enable browsedFile
|
||||||
++ cfg.drivers;
|
++ cfg.drivers;
|
||||||
pathsToLink = [ "/etc/cups" ];
|
pathsToLink = [ "/etc/cups" ];
|
||||||
ignoreCollisions = true;
|
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 {
|
browsedConf = mkOption {
|
||||||
type = types.lines;
|
type = types.lines;
|
||||||
default = "";
|
default = "";
|
||||||
@ -419,7 +427,7 @@ in
|
|||||||
serviceConfig.PrivateTmp = true;
|
serviceConfig.PrivateTmp = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.cups-browsed = mkIf avahiEnabled
|
systemd.services.cups-browsed = mkIf cfg.browsed.enable
|
||||||
{ description = "CUPS Remote Printer Discovery";
|
{ description = "CUPS Remote Printer Discovery";
|
||||||
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
Loading…
Reference in New Issue
Block a user