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.our;
|
||||
let
|
||||
|
@ -7,13 +7,42 @@ in
|
|||
{
|
||||
options.modules.hardware.peripherals.printing = with types; {
|
||||
enable = mkBoolOpt false;
|
||||
drivers = mkOpt (functionTo listOf package) (pkgs: [ ]);
|
||||
drivers = mkOpt (listOf path) [ ];
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.printing = {
|
||||
enable = true;
|
||||
drivers = cfg.drivers pkgs;
|
||||
};
|
||||
};
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
{
|
||||
services.printing = {
|
||||
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