36 lines
946 B
Nix
36 lines
946 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
moduleName = "nixos-printers";
|
|
in
|
|
{
|
|
# ---- Printing (CUPS) ----
|
|
services.printing = {
|
|
enable = true;
|
|
# Good general compatibility. Many modern printers work driverless (IPP Everywhere),
|
|
# but these help with older models and various formats.
|
|
drivers = with pkgs; [
|
|
cups-filters
|
|
gutenprint
|
|
];
|
|
};
|
|
|
|
# ---- Network printer discovery (mDNS / DNS-SD) ----
|
|
services.avahi = {
|
|
enable = true;
|
|
# Resolve .local names + discover services on IPv4
|
|
nssmdns4 = true;
|
|
# You're controlling firewall rules in firewall.nix
|
|
openFirewall = false;
|
|
};
|
|
|
|
# ---- Optional GUI tool to add/manage printers ----
|
|
environment.systemPackages = with pkgs; [
|
|
system-config-printer
|
|
];
|
|
|
|
# allow admin actions in printer GUI (usually already present on desktop systems)
|
|
security.polkit.enable = true;
|
|
environment.etc."nixlog/loaded.${moduleName}".text = "loaded\n";
|
|
}
|