diff options
| author | Thomas Gerbet <thomas@gerbet.me> | 2024-09-26 19:49:52 +0200 |
|---|---|---|
| committer | github-actions[bot] <github-actions[bot]@users.noreply.github.com> | 2024-09-26 18:45:28 +0000 |
| commit | 48db5e72f2c9efd0025f7d16057814bd41866a7e (patch) | |
| tree | b702b0e4a48c55d9031c5a2523894fad786bfe80 | |
| parent | [24.05] cinnamon.cinnamon-screensaver: Ignore shift-f10 keybinding (#344441) (diff) | |
| download | nixpkgs-origin/backport-344702-to-release-24.05.tar.gz | |
nixos/printing: add option to disable browsed daemonorigin/backport-344702-to-release-24.05
It is currently tied to `services.avahi.enable` which might not be
desirable.
With this change it is possible to disable the service with
`services.printing.browsed.enable = false`
(cherry picked from commit 981a63b005475121efadf9a6bcead017b101bee4)
| -rw-r--r-- | nixos/modules/services/printing/cupsd.nix | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/nixos/modules/services/printing/cupsd.nix b/nixos/modules/services/printing/cupsd.nix index 668bccab2e2d..2e128f49c86b 100644 --- a/nixos/modules/services/printing/cupsd.nix +++ b/nixos/modules/services/printing/cupsd.nix @@ -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" ]; |
