profiles: printing: setup default paper size

This commit is contained in:
Bruno BELANYI 2022-12-16 12:34:01 +01:00
parent 0b7257cfb9
commit c6b3325269

View file

@ -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;