From 1a67a3eeaac68a15516b36ddecdde83c76c99a52 Mon Sep 17 00:00:00 2001 From: Mark Nipper Date: Wed, 8 Oct 2025 14:28:19 -0700 Subject: Modularize printer configuration --- hosts/common/optional/printer.nix | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 hosts/common/optional/printer.nix (limited to 'hosts/common/optional/printer.nix') diff --git a/hosts/common/optional/printer.nix b/hosts/common/optional/printer.nix new file mode 100644 index 0000000..e3109fc --- /dev/null +++ b/hosts/common/optional/printer.nix @@ -0,0 +1,21 @@ +{ + hardware.printers = let + brother = "Brother_HL-L2340D"; + ip = "192.168.1.20"; + in { + ensureDefaultPrinter = brother; + ensurePrinters = [{ + name = brother; + deviceUri = "ipp://${ip}/ipp"; + model = "everywhere"; + description = lib.replaceStrings [ "_" ] [ " " ] brother; + location = "home"; + }]; + }; + + systemd.services."ensure-printers" = { + after = [ "network-online.target" ]; + preStart = "sleep 5"; + wants = [ "network-online.target" ]; + }; +} -- cgit v1.2.3