From c9463663b49db03e7ed48011a5655456b89b9102 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Fri, 5 Jul 2024 21:03:57 +0400 Subject: [PATCH] add printing module --- modules/desktop/default.nix | 1 + modules/desktop/printing/default.nix | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 modules/desktop/printing/default.nix diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 44e8fde6..2b96860b 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -24,5 +24,6 @@ ./plymouth # vpn ./wireguard + ./printing ]; } diff --git a/modules/desktop/printing/default.nix b/modules/desktop/printing/default.nix new file mode 100644 index 00000000..d327702b --- /dev/null +++ b/modules/desktop/printing/default.nix @@ -0,0 +1,27 @@ +{ + options, + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.modules.desktop.printing; +in { + options.modules.desktop.printing = { + enable = mkEnableOption false; + }; + + config = mkIf cfg.enable { + # enable printing itself + services.printing.enable = true; + + # autodiscovery of printers + services.avahi = { + enable = true; + nssmdns = true; + openFirewall = true; + }; + + }; +}