printer ntnu init
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -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 = [
|
||||
|
||||
@@ -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";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user