summaryrefslogtreecommitdiff
path: root/nixos/modules
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/hardware/printer.nix34
-rw-r--r--nixos/modules/module-list.nix1
2 files changed, 35 insertions, 0 deletions
diff --git a/nixos/modules/hardware/printer.nix b/nixos/modules/hardware/printer.nix
new file mode 100644
index 0000000..23aa554
--- /dev/null
+++ b/nixos/modules/hardware/printer.nix
@@ -0,0 +1,34 @@
+{ config, lib, pkgs, ... }:
+with lib;
+
+let
+ cfg = config.eth.hardware.printer;
+
+in {
+
+ options.eth.hardware.printer = {
+ enable = mkEnableOption "Whether to enable Eth's home printer";
+ };
+
+ config = mkIf cfg.enable {
+ # Avahi is needed for dnssd (mDNS / Bonjour) printers.
+ services.avahi = {
+ enable = true;
+ nssmdns = true;
+ };
+
+ services.printing = {
+ enable = true;
+ drivers = with pkgs; [ brlaser ];
+ };
+
+ hardware.printers.ensurePrinters = [
+ {
+ name = "Brother_HL-1210W";
+ description = "Brother HL-1210W";
+ deviceUri = "dnssd://Brother%20HL-1210W%20series._pdl-datastream._tcp.local/?uuid=e3248000-80ce-11db-8000-d89c67c1755c";
+ model = "drv:///brlaser.drv/br1200.ppd";
+ }
+ ];
+ };
+}
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index a734519..247d9a6 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -1,6 +1,7 @@
[
./hardware/keyboard.nix
./hardware/linode.nix
+ ./hardware/printer.nix
./hardware/touchpad.nix
./hardware/yubikey.nix
./location.nix