From 02abf4ed0131237c25e0a10db50fa4c41a902a50 Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Sun, 14 Jul 2024 17:53:13 -0600 Subject: sys: final merge of dmz, hv into sys --- sys/hardware/printing.nix | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 sys/hardware/printing.nix (limited to 'sys/hardware/printing.nix') diff --git a/sys/hardware/printing.nix b/sys/hardware/printing.nix new file mode 100644 index 0000000..8280da9 --- /dev/null +++ b/sys/hardware/printing.nix @@ -0,0 +1,32 @@ +{ config, lib, ... }: +with lib; let + cfg = config.local.hardware.printing; +in +{ + options.local.hardware.printing = { + enable = mkEnableOption "print and scan services"; + + users = mkOption { + type = with types; listOf str; + default = [ ]; + }; + }; + + config = mkIf cfg.enable { + services.avahi = { + enable = true; + nssmdns4 = true; + openFirewall = true; + }; + + hardware.sane.enable = true; + services.printing.enable = true; + + users.users = listToAttrs (map + (user: { + name = user; + value.extraGroups = [ "scanner" "lp" ]; + }) + cfg.users); + }; +} -- cgit v1.2.3