grimm-nixos-laptop/common/printing.nix
2024-05-11 22:55:59 +02:00

36 lines
790 B
Nix

{
pkgs,
config,
lib,
...
}:
let
inherit (config.grimmShared) enable printing graphical;
in
{
config = lib.mkIf (enable && printing) {
# Enable CUPS to print documents.
services.printing.enable = true;
services.printing.drivers = with pkgs; [
brgenml1lpr
brgenml1cupswrapper
];
services.avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
services.printing.cups-pdf.enable = true;
hardware.sane.brscan4.enable = true; # enables support for SANE scanners
environment.systemPackages = (
lib.optionals graphical [
pkgs.kdePackages.skanpage
# libsForQt5.skanpage
]
);
};
options.grimmShared.printing = lib.mkEnableOption "Enables print and scan related options";
}