{ config, lib, pkgs, ... }: let gutenprintWithVersion = "gutenprint.${lib.versions.majorMinor (lib.getVersion pkgs.gutenprint)}"; in lib.mkIf config.sbruder.gui.enable { services = { printing = { enable = true; drivers = with pkgs; [ gutenprint ] ++ lib.optional config.sbruder.unfree.allowSoftware (cups-kyocera-ecosys-m552x-p502x.override { # in Kyocera terms, EU means duplex enabled by default region = "EU"; }); }; avahi.enable = true; }; hardware.printers.ensurePrinters = [ { name = "ich_drucke_nicht"; deviceUri = "socket://192.168.178.26"; model = "${gutenprintWithVersion}://bjc-TS3100-series/expert"; } ] ++ lib.optionals config.sbruder.unfree.allowSoftware [ { name = "elma"; deviceUri = "socket://elma.home.sbruder.de"; model = "Kyocera/Kyocera ECOSYS P5021cdn.PPD"; } ]; }