nixos/hosts/common/optional/print-server.nix

47 lines
1000 B
Nix
Raw Normal View History

2025-01-24 12:33:21 +00:00
{pkgs, ...}: {
networking.firewall = {
allowedTCPPorts = [631];
allowedUDPPorts = [631];
};
services = {
printing = {
enable = true;
drivers = [pkgs.hplip];
browsing = true;
defaultShared = true;
listenAddresses = ["*:631"];
allowFrom = ["all"];
extraConf = ''
DefaultPaperSize A4
'';
};
avahi = {
enable = true;
nssmdns = true;
openFirewall = true;
publish = {
enable = true;
userServices = true;
};
};
};
hardware.printers = {
ensurePrinters = [
{
name = "HP_Envy_6000";
location = "Home";
deviceUri = "usb://HP/ENVY%206000%20series?serial=TH0B93F08W&interface=1";
# deviceUri = "usb://Dell/1250c%20Color%20Printer?serial=YNP023240";
model = "HP/hp-deskjet_plus_6000_series.ppd.gz";
ppdOptions = {
PageSize = "A4";
};
}
];
ensureDefaultPrinter = "HP_Envy_6000";
};
}