printer ntnu init

This commit is contained in:
2026-05-13 18:29:54 +02:00
parent d520210bfe
commit ec484c94a8
3 changed files with 2868 additions and 0 deletions
File diff suppressed because it is too large Load Diff
+28
View File
@@ -42,6 +42,34 @@
nvidiaBusId = "PCI:1:0:0";
};
services.avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
services.printing = {
enable = true;
drivers = [
pkgs.cups-filters
pkgs.cups-browsed
(pkgs.writeTextDir "share/cups/model/myPrint_PS.ppd" (builtins.readFile ./../../myPrint_PS.ppd))
];
};
hardware.printers.ensurePrinters = [
{
name = "NTNU-Print";
location = "NTNU";
# Username and password needs to be set.
deviceUri = "https://username:password@myprint.ntnu.no/RicohmyPrint/printers/ipp/print";
model = "myPrint_PS.ppd";
ppdOptions = {
PageSize = "A4";
};
}
];
fonts.fontconfig.enable = true;
fonts.fontconfig.defaultFonts = {
monospace = [
+29
View File
@@ -0,0 +1,29 @@
{
lib,
config,
...
}:
let
cfg = config.services.ntnuPrinting;
in
{
options.services.ntnuPrinting.enable = lib.mkEnableOption "Enable NTNU printing service";
config = lib.mkIf cfg.enable {
services.printing.enable = true;
services.printing.browsed.enable = true;
hardware.printers.ensurePrinters = [
{
name = "NTNU-Print";
location = "NTNU";
deviceUri = "https://myprint.ntnu.no/RicohmyPrint/printers/ipp/print";
model = "myPrint_PS.ppd";
ppdOptions = {
PageSize = "A4";
};
}
];
};
}