services: printing: init
Adds CUPS and avahi for printing and discovering printers on the network.
This commit is contained in:
parent
22ab0638d2
commit
609e8e4439
1 changed files with 42 additions and 0 deletions
42
modules/services/printing/module.nix
Normal file
42
modules/services/printing/module.nix
Normal file
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.options) mkEnableOption;
|
||||
in {
|
||||
options.modules.services.cups.enable = mkEnableOption "CUPS, the Common UNIX printing system";
|
||||
|
||||
config = {
|
||||
services = {
|
||||
# enable CUPS, the Common UNIX printing system.
|
||||
printing = {
|
||||
enable = true;
|
||||
|
||||
# Move CUPSd's temporary directory.
|
||||
# By default, it resides in /tmp.
|
||||
tempDir = "/tmp/cups";
|
||||
|
||||
# Do not advertise shared printers.
|
||||
browsing = false;
|
||||
|
||||
# Enable the CUPS webinterface, accessible at localhost:631.
|
||||
webInterface = true;
|
||||
|
||||
# Some local or network printers might need additional drivers.
|
||||
# These can be added into here.
|
||||
drivers = [
|
||||
pkgs.cups-kyocera-ecosys-m552x-p502x
|
||||
];
|
||||
};
|
||||
|
||||
# Add and autodiscover printers on the network via the IPP everywhere[1] protocol.
|
||||
# [1] https://www.pwg.org/ipp/everywhere.html
|
||||
avahi = {
|
||||
enable = true;
|
||||
nssmdns4 = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue