peripherals/printing: revamp module, add itap printers
This commit is contained in:
parent
0817ab96aa
commit
7a08cb310d
1 changed files with 37 additions and 8 deletions
|
@ -1,4 +1,4 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, private, ... }:
|
||||||
with lib;
|
with lib;
|
||||||
with lib.our;
|
with lib.our;
|
||||||
let
|
let
|
||||||
|
@ -7,13 +7,42 @@ in
|
||||||
{
|
{
|
||||||
options.modules.hardware.peripherals.printing = with types; {
|
options.modules.hardware.peripherals.printing = with types; {
|
||||||
enable = mkBoolOpt false;
|
enable = mkBoolOpt false;
|
||||||
drivers = mkOpt (functionTo listOf package) (pkgs: [ ]);
|
drivers = mkOpt (listOf path) [ ];
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable (mkMerge [
|
||||||
services.printing = {
|
{
|
||||||
enable = true;
|
services.printing = {
|
||||||
drivers = cfg.drivers pkgs;
|
enable = true;
|
||||||
};
|
inherit (cfg) drivers;
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
(mkIf config.info.loc.purdue {
|
||||||
|
hardware.printers = {
|
||||||
|
ensureDefaultPrinter = "printing";
|
||||||
|
|
||||||
|
ensurePrinters =
|
||||||
|
let
|
||||||
|
itap = name: {
|
||||||
|
inherit name;
|
||||||
|
deviceUri = "lpd://${private.variables.purdue-username}@wpvapppcprt02.itap.purdue.edu:515/itap-${name}";
|
||||||
|
model = "drv:///sample.drv/generic.ppd";
|
||||||
|
ppdOptions = {
|
||||||
|
Duplex = "DuplexNoTumble";
|
||||||
|
Option1 = "True"; # Duplexer
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in
|
||||||
|
[
|
||||||
|
(itap "printing")
|
||||||
|
(itap "colorprinting")
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
services.printing.browsedConf = ''
|
||||||
|
BrowseRemoteProtocols none
|
||||||
|
'';
|
||||||
|
})
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue