os/modules/printing/default.nix
teutat3s 0212b85efc
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
style: run treefmt, remove unused recursive-merge
2024-01-06 17:30:35 +01:00

41 lines
854 B
Nix

{
flake,
config,
pkgs,
lib,
...
}: {
services.avahi.enable = true;
services.avahi.ipv6 = true;
services.avahi.nssmdns = true;
services.avahi.publish.enable = true;
services.avahi.publish.userServices = true;
services.printing.enable = true;
services.printing.browsing = true;
services.printing.listenAddresses = ["localhost:631"];
services.printing.defaultShared = lib.mkDefault false;
services.printing.drivers =
[
pkgs.gutenprint
]
++ (
if (pkgs.system == "x86_64-linux")
then [pkgs.cups-brother-hl3140cw]
else []
);
networking.hosts = flake.self.lib.addLocalHostname ["cups.local"];
services.caddy = {
enable = true;
extraConfig = ''
cups.local {
request_header Host localhost:631
reverse_proxy unix//run/cups/cups.sock
}
'';
};
}