nixos-config/modules/cups.nix
Simon Bruder 10b8d432d5
Relicense
This applies the REUSE specification to the repository, so the licensing
information can be tracked for every file individually.
2024-01-13 14:39:22 +01:00

37 lines
1,022 B
Nix

# SPDX-FileCopyrightText: 2020-2022 Simon Bruder <simon@sbruder.de>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
{ 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.fritz.box";
model = "Kyocera/Kyocera ECOSYS P5021cdn.PPD";
}
];
}