nixos-config/modules/cups.nix

37 lines
1,022 B
Nix
Raw Permalink Normal View History

# SPDX-FileCopyrightText: 2020-2022 Simon Bruder <simon@sbruder.de>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
2020-12-05 13:48:06 +01:00
{ config, lib, pkgs, ... }:
2020-10-18 22:25:05 +02:00
let
gutenprintWithVersion = "gutenprint.${lib.versions.majorMinor (lib.getVersion pkgs.gutenprint)}";
in
lib.mkIf config.sbruder.gui.enable {
2020-08-30 13:20:57 +02:00
services = {
printing = {
enable = true;
drivers = with pkgs; [
gutenprint
2021-12-01 18:24:04 +01:00
] ++ lib.optional config.sbruder.unfree.allowSoftware (cups-kyocera-ecosys-m552x-p502x.override {
2021-07-04 20:51:28 +02:00
# in Kyocera terms, EU means duplex enabled by default
region = "EU";
});
2020-08-30 13:20:57 +02:00
};
avahi.enable = true;
2020-08-29 23:54:35 +02:00
};
2020-10-18 22:25:05 +02:00
hardware.printers.ensurePrinters = [
{
name = "ich_drucke_nicht";
deviceUri = "socket://192.168.178.26";
model = "${gutenprintWithVersion}://bjc-TS3100-series/expert";
}
2021-07-04 20:51:28 +02:00
] ++ lib.optionals config.sbruder.unfree.allowSoftware [
{
name = "elma";
2022-09-24 19:29:32 +02:00
deviceUri = "socket://elma.fritz.box";
2021-07-04 20:51:28 +02:00
model = "Kyocera/Kyocera ECOSYS P5021cdn.PPD";
}
2020-10-18 22:25:05 +02:00
];
2020-08-22 17:44:39 +02:00
}