flake: pull printing out into global modules

This commit is contained in:
Infinidoge 2025-03-11 14:05:31 -04:00
parent 28c5624eb8
commit e941f94e3c
Signed by: Infinidoge
SSH key fingerprint: SHA256:oAMyvotlNFraMmZmr+p6AxnNfW/GioTs1pOn3V4tQ7A
6 changed files with 58 additions and 89 deletions

View file

@ -1,54 +0,0 @@
{
config,
lib,
private,
...
}:
with lib;
with lib.our;
let
cfg = config.modules.hardware.peripherals.printing;
in
{
options.modules.hardware.peripherals.printing = with types; {
enable = mkBoolOpt false;
drivers = mkOpt (listOf path) [ ];
};
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}";
deviceUri = "lpd://${private.variables.purdue-username}@128.210.210.41: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
'';
})
]);
}