From 776bead26e2f80f4294edae1c18b7f715b1e3b12 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Fri, 30 Jun 2023 12:26:00 +0200 Subject: [PATCH] Add printer --- hardware/printer/hp-laserjet-p1005.nix | 17 +++++++++++++++++ hosts/sopp/default.nix | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 hardware/printer/hp-laserjet-p1005.nix diff --git a/hardware/printer/hp-laserjet-p1005.nix b/hardware/printer/hp-laserjet-p1005.nix new file mode 100644 index 0000000..c7ae613 --- /dev/null +++ b/hardware/printer/hp-laserjet-p1005.nix @@ -0,0 +1,17 @@ +{ lib, pkgs, ... }: +{ + # https://nixos.wiki/wiki/Printing + services.printing.enable = true; + services.printing.drivers = with pkgs; [ foo2zjs 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 = "usb://HP/LaserJet%20P1005?serial=BC0CAEQ"; # `lpstat -s` + model = "HP-LaserJet_P1005.ppd.gz"; # `lpinfo -m` + #location = ""; + description = "Laser printer"; + ppdOptions.PageSize = "A4"; + }; +} diff --git a/hosts/sopp/default.nix b/hosts/sopp/default.nix index 2e32fcb..d189deb 100644 --- a/hosts/sopp/default.nix +++ b/hosts/sopp/default.nix @@ -22,6 +22,7 @@ ./hardware-configuration.nix ../../hardware/gpu/cuda.nix ../../hardware/gpu/intel.nix + ../../hardware/printer/hp-laserjet-p1005.nix ../../profiles/auto-upgrade.nix ../../users # home-manager @@ -94,7 +95,6 @@ /**/ #TODO: avahi? resolved? https://git.pvv.ntnu.no/Drift/pvv-nixos-config/src/main/base.nix#L15-L18 - # Installed system packages environment.systemPackages = with pkgs; [ cage