ljasdjklasdjklas

This commit is contained in:
2025-11-26 03:13:47 +01:00
parent 2295431eeb
commit 4ed3938223
8 changed files with 65 additions and 29 deletions

View File

@@ -0,0 +1,20 @@
{ lib, pkgs, ... }:
{
# airprint
# https://wiki.nixos.org/wiki/Printing#Printer_sharing
services.avahi = {
enable = lib.mkDefault true;
nssmdns = true;
openFirewall = true; # opens UDP port 5353
};
services.printing = {
enable = lib.mkDefault true;
drivers = [
pkgs.cups-filters
pkgs.cups-browsed
];
};
}

View File

@@ -1,25 +1,25 @@
{ lib, pkgs, ... }:
{
imports = [
./common-share.nix
];
# imports = [ ./share.nix ]; # up to the host to opt-in to
# https://wiki.nixos.org/wiki/Printing
services.printing.enable = true;
services.printing.enable = lib.mkDefault true;
#services.printing.drivers = with pkgs; [ foo2zjs foomatic-filters cups-filters ];
#services.printing.drivers = with pkgs; [ foo2zjs hplip foomatic-filters cups-filters ];
services.printing.drivers = with pkgs; [ foo2zjs hplipWithPlugin foomatic-filters cups-filters ];
#services.printing.drivers = with pkgs; [ hplipWithPlugin cups-filters ];
#hardware.printers.ensureDefaultPrinter = lib.mkDefault "HP_LaserJet_P1005";
hardware.printers.ensurePrinters = lib.singleton {
name = "HP_LaserJet_P1005";
deviceUri = "hp:/usb/HP_LaserJet_P1005?serial=BC0CAEQ"; # `lpstat -s` # hplip
#deviceUri = "usb://HP/LaserJet%20P1005?serial=BC0CAEQ"; # `lpstat -s` # foo2zjs
model = "HP-LaserJet_P1005.ppd.gz"; # `lpinfo -m` # foo2zjs
#location = "";
description = "Laser printer";
ppdOptions.PageSize = "A4";
hardware.printers = {
ensureDefaultPrinter = lib.mkDefault "HP_LaserJet_P1005";
ensurePrinters = lib.singleton {
name = "HP_LaserJet_P1005";
deviceUri = "hp:/usb/HP_LaserJet_P1005?serial=BC0CAEQ"; # `lpstat -s` # hplip
# deviceUri = "usb://HP/LaserJet%20P1005?serial=BC0CAEQ"; # `lpstat -s` # foo2zjs
model = "HP-LaserJet_P1005.ppd.gz"; # `lpinfo -m` # foo2zjs
#location = "";
description = "Laser printer";
ppdOptions.PageSize = "A4";
};
};
services.printing.logLevel = "debug";

View File

@@ -1,13 +1,15 @@
{ lib, pkgs, ... }:
{
# airprint
# https://wiki.archlinux.org/title/CUPS/Printer_sharing
# https://wiki.nixos.org/wiki/Printing#Printer_sharing
services.avahi = {
enable = lib.mkDefault true;
nssmdns = true;
openFirewall = true; # opens port 5353
publish.enable = true;
publish.userServices = true;
};