From c6b3325269d6b27aecfd706161d87c7cca32f7a6 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Fri, 16 Dec 2022 12:34:01 +0100 Subject: [PATCH] profiles: printing: setup default paper size --- profiles/printing/default.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/profiles/printing/default.nix b/profiles/printing/default.nix index 90f6c6b..9965797 100644 --- a/profiles/printing/default.nix +++ b/profiles/printing/default.nix @@ -6,6 +6,23 @@ in options.my.profiles.printing = with lib; { enable = mkEnableOption "printing profile"; + papersize = mkOption { + type = with types; either str (enum [ + "a3" + "a4" + "a5" + "b5" + "letter" + "legal" + "executive" + "note" + "11x17" + ]); + default = "a4"; + example = "paper"; + description = "preferred paper size"; + }; + usb = { enable = my.mkDisableOption "USB printers"; }; @@ -31,6 +48,11 @@ in ]; }; + # Setup paper size + systemd.services.cups.serviceConfig.Environment = [ + "PAPERSIZE=${cfg.papersize}" + ]; + # Allow using USB printers services.ipp-usb = lib.mkIf cfg.usb.enable { enable = true;