aboutsummaryrefslogtreecommitdiffstats
path: root/hosts/common
diff options
context:
space:
mode:
authorMark Nipper <nipsy@bitgnome.net>2025-10-08 14:28:19 -0700
committerMark Nipper <nipsy@bitgnome.net>2025-10-08 14:28:19 -0700
commit1a67a3eeaac68a15516b36ddecdde83c76c99a52 (patch)
tree5b18fb44a11fc7d4cbfcc496b09b8e9f2f8a3644 /hosts/common
parent9c75409c9c2a5154eaf503026b97cf50dc2fa70e (diff)
downloadnix-1a67a3eeaac68a15516b36ddecdde83c76c99a52.tar
nix-1a67a3eeaac68a15516b36ddecdde83c76c99a52.tar.gz
nix-1a67a3eeaac68a15516b36ddecdde83c76c99a52.tar.bz2
nix-1a67a3eeaac68a15516b36ddecdde83c76c99a52.tar.lz
nix-1a67a3eeaac68a15516b36ddecdde83c76c99a52.tar.xz
nix-1a67a3eeaac68a15516b36ddecdde83c76c99a52.tar.zst
nix-1a67a3eeaac68a15516b36ddecdde83c76c99a52.zip
Modularize printer configuration
Diffstat (limited to 'hosts/common')
-rw-r--r--hosts/common/optional/printer.nix21
1 files changed, 21 insertions, 0 deletions
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" ];
+ };
+}