From c9867532be13d993aeccf45883c0d7a248f4db08 Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Thu, 2 Dec 2021 09:24:30 -0500 Subject: [PATCH] peripherals/printing: add printing module --- .../modules/hardware/peripherals/printing.nix | 19 +++++++++++++++++++ profiles/peripherals/printing.nix | 15 --------------- 2 files changed, 19 insertions(+), 15 deletions(-) create mode 100644 modules/modules/hardware/peripherals/printing.nix delete mode 100644 profiles/peripherals/printing.nix diff --git a/modules/modules/hardware/peripherals/printing.nix b/modules/modules/hardware/peripherals/printing.nix new file mode 100644 index 0000000..6ae2fbd --- /dev/null +++ b/modules/modules/hardware/peripherals/printing.nix @@ -0,0 +1,19 @@ +{ config, lib, pkgs, ... }: +with lib; +with lib.hlissner; +let + cfg = config.modules.hardware.peripherals.printing; +in +{ + options.modules.hardware.peripherals.printing = with types; { + enable = mkBoolOpt false; + drivers = mkOpt (functionTo listOf package) (pkgs: [ ]); + }; + + config = mkIf cfg.enable { + services.printing = { + enable = true; + drivers = cfg.drivers pkgs; + }; + }; +} diff --git a/profiles/peripherals/printing.nix b/profiles/peripherals/printing.nix deleted file mode 100644 index 0bd5c94..0000000 --- a/profiles/peripherals/printing.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ pkgs, ... }: { - services.printing = { - enable = true; - drivers = with pkgs; [ - cnijfilter2 - gutenprintBin - cupsBjnp - cups-bjnp - canon-cups-ufr2 - carps-cups - cnijfilter_2_80 - cnijfilter_4_00 - ]; - }; -}