]> Git — Sourcephile - julm/julm-nix.git/blob - nixos/profiles/printing.nix
aubergine: wifi: unhide SSID
[julm/julm-nix.git] / nixos / profiles / printing.nix
1 { pkgs, lib, config, ... }:
2 {
3 imports = [
4 ./avahi.nix
5 ];
6 services.printing = {
7 enable = true;
8 drivers = [
9 pkgs.canon-cups-ufr2
10 pkgs.cups-filters
11 pkgs.gutenprint
12 pkgs.hplip
13 ];
14 };
15 hardware.sane.enable = true;
16 hardware.sane.extraBackends = [
17 pkgs.hplipWithPlugin
18 pkgs.sane-airscan
19 ];
20 services.colord.enable = true;
21 # ExplanationNote: cups-browsed only supports avahi, not systemd-resolved
22 services.avahi.enable = lib.mkDefault true;
23 services.resolved.extraConfig = ''
24 MulticastDNS=false
25 '';
26 networking.nftables.ruleset = ''
27 table inet filter {
28 chain output-lan {
29 tcp dport { ipp, ipps } counter accept comment "printing: IPP"
30 tcp dport sane-port counter accept comment "sane-net: control port"
31 tcp dport {40000 - 40100} counter accept comment "saned: data ports"
32 }
33 }
34 '' + lib.optionalString config.hardware.sane.openFirewall ''
35 table inet filter {
36 chain input-lan {
37 udp canon-bjnp2 counter accept comment "sane: discovery of scanners on the local network"
38 }
39 }
40 '';
41 }