From c9409866b7d8d7f0a5c2b2fbf151a113fbfb4b44 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 19 Jul 2024 13:09:20 +0100 Subject: [PATCH] enable printing and add network printer --- hosts/common/optional/printing.nix | 28 ++++++++++++++++++++++++++++ hosts/semita/default.nix | 1 + hosts/sparky/default.nix | 1 + 3 files changed, 30 insertions(+) create mode 100644 hosts/common/optional/printing.nix diff --git a/hosts/common/optional/printing.nix b/hosts/common/optional/printing.nix new file mode 100644 index 0000000..cd923f9 --- /dev/null +++ b/hosts/common/optional/printing.nix @@ -0,0 +1,28 @@ +{ pkgs, ... }: +{ + services = { + printing = { + enable = true; + drivers = [ pkgs.gutenprint pkgs.hplip ]; + }; + avahi = { + enable = true; + nssmdns4 = true; + openFirewall = true; + }; + }; + hardware.printers = { + ensurePrinters = [ + { + name = "HP_ENVY_6000"; + description = "Network printer hosted on bob"; + location = "bob"; + deviceUri = "ipp://bob/printers/HP_ENVY_6000_series"; + model = "everywhere"; + ppdOptions = { + PageSize = "A4"; + }; + } + ]; + }; +} diff --git a/hosts/semita/default.nix b/hosts/semita/default.nix index 269d89b..ffe8367 100644 --- a/hosts/semita/default.nix +++ b/hosts/semita/default.nix @@ -31,6 +31,7 @@ in ../common/optional/openssh.nix ../common/optional/dwm.nix ../common/optional/nfs-mounts/music.nix + ../common/optional/printing.nix ]; diff --git a/hosts/sparky/default.nix b/hosts/sparky/default.nix index 60b45c0..9cb95cc 100644 --- a/hosts/sparky/default.nix +++ b/hosts/sparky/default.nix @@ -28,6 +28,7 @@ in ../common/optional/openssh.nix ../common/optional/persistence.nix ../common/optional/gaming.nix + ../common/optional/printing.nix ];