os/modules/printing/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

41 lines
882 B
Nix
Raw Normal View History

2021-05-30 19:10:28 +00:00
{
2023-10-07 12:06:28 +00:00
flake,
2021-05-30 19:10:28 +00:00
config,
pkgs,
2023-10-07 12:06:28 +00:00
lib,
2021-05-30 19:10:28 +00:00
...
2023-10-07 12:06:28 +00:00
}: {
services.avahi.enable = true;
services.avahi.ipv6 = true;
2023-10-07 12:06:28 +00:00
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.allowFrom = ["all"];
services.printing.defaultShared = false;
services.printing.drivers = [
pkgs.gutenprint
pkgs.cups-brother-hl3140cw
];
hardware.sane = {
enable = true;
extraBackends = [pkgs.hplipWithPlugin];
2021-05-30 19:10:28 +00:00
};
2023-10-07 12:06:28 +00:00
networking.hosts = flake.self.lib.addLocalHostname ["cups.local"];
services.caddy = {
2023-10-07 19:11:08 +00:00
enable = true;
2023-10-07 12:06:28 +00:00
extraConfig = ''
cups.local {
request_header Host localhost:631
reverse_proxy unix//run/cups/cups.sock
}
2023-10-07 12:06:28 +00:00
'';
2021-05-30 19:10:28 +00:00
};
}