41 lines
887 B
Nix
41 lines
887 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.allowFrom = ["all"];
|
|
services.printing.defaultShared = false;
|
|
services.printing.drivers = [
|
|
pkgs.gutenprint
|
|
pkgs.cups-brother-hl3140cw
|
|
];
|
|
|
|
hardware.sane = {
|
|
enable = true;
|
|
extraBackends = [pkgs.hplipWithPlugin];
|
|
};
|
|
|
|
networking.hosts = flake.self.lib.addLocalHostname ["cups.local"];
|
|
|
|
services.caddy = {
|
|
enable = true;
|
|
extraConfig = ''
|
|
cups.b12f.io:80 {
|
|
request_header Host localhost:631
|
|
reverse_proxy unix//run/cups/cups.sock
|
|
}
|
|
'';
|
|
};
|
|
}
|