[printing] init module
This commit is contained in:
51
machines/modules/malobeo/printing.nix
Normal file
51
machines/modules/malobeo/printing.nix
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.services.malobeo.printing;
|
||||||
|
driverFile = pkgs.writeTextDir "share/cups/model/konicaminoltac258.ppd" (builtins.readFile ../KOC658UX.ppd);
|
||||||
|
|
||||||
|
defaultPpdOptions = {
|
||||||
|
PageSize = "A4";
|
||||||
|
SelectColor = "Grayscale";
|
||||||
|
Finisher = "FS534";
|
||||||
|
SaddleUnit = "SD511";
|
||||||
|
Model = "C258";
|
||||||
|
InputSlot = "Tray1";
|
||||||
|
};
|
||||||
|
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.services.malobeo.printing = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Setup malobeo printers";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf (cfg.enable) {
|
||||||
|
services.printing.enable = true;
|
||||||
|
services.printing.drivers = [
|
||||||
|
driverFile
|
||||||
|
];
|
||||||
|
|
||||||
|
hardware.printers.ensurePrinters = [ {
|
||||||
|
name = "KonicaDefault";
|
||||||
|
model = "konicaminoltac258.ppd";
|
||||||
|
location = "Zine Workshop";
|
||||||
|
deviceUri = "ipp://192.168.1.42/ipp";
|
||||||
|
ppdOptions = defaultPpdOptions;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "KonicaBooklet";
|
||||||
|
model = "konicaminoltac258.ppd";
|
||||||
|
location = "Zine Workshop";
|
||||||
|
deviceUri = "ipp://192.168.1.42/ipp";
|
||||||
|
ppdOptions = defaultPpdOptions // {
|
||||||
|
Fold = "Stitch";
|
||||||
|
Staple = "None";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -117,6 +117,7 @@ in (utils.lib.eachSystem (builtins.filter filter_system utils.lib.defaultSystems
|
|||||||
disko.imports = [ ./machines/modules/disko ];
|
disko.imports = [ ./machines/modules/disko ];
|
||||||
users.imports = [ ./machines/modules/malobeo/users.nix ];
|
users.imports = [ ./machines/modules/malobeo/users.nix ];
|
||||||
backup.imports = [ ./machines/modules/malobeo/backup.nix ];
|
backup.imports = [ ./machines/modules/malobeo/backup.nix ];
|
||||||
|
printing.imports = [ ./machines/modules/malobeo/printing.nix ];
|
||||||
};
|
};
|
||||||
|
|
||||||
hydraJobs = nixpkgs.lib.mapAttrs (_: nixpkgs.lib.hydraJob) (
|
hydraJobs = nixpkgs.lib.mapAttrs (_: nixpkgs.lib.hydraJob) (
|
||||||
|
|||||||
Reference in New Issue
Block a user