nix-dotfiles/modules/hardware/print.nix
2025-03-07 15:39:51 -08:00

32 lines
786 B
Nix

{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.modules.hardware.print;
in {
options.modules.hardware.print = {
enable = mkEnableOption "Enable various print services";
};
config = mkIf cfg.enable {
services.printing.enable = true;
services.printing.startWhenNeeded = true;
# this drains battery and everything i need is local
# also happened to have an RCE in the past
services.printing.browsed.enable = false;
services.printing.drivers = with pkgs; [
# gutenprint is very generic and supports a lot of printers
gutenprint
gutenprintBin
# brother laser printers
brlaser
];
# network discovery
services.avahi = {
enable = true;
openFirewall = true;
nssmdns4 = true;
};
};
}