2021-05-30 19:10:28 +00:00
|
|
|
{
|
2024-01-06 09:46:10 +00:00
|
|
|
flake,
|
2021-05-30 19:10:28 +00:00
|
|
|
config,
|
|
|
|
pkgs,
|
2024-01-06 09:46:10 +00:00
|
|
|
lib,
|
2021-05-30 19:10:28 +00:00
|
|
|
...
|
2024-01-06 09:46:10 +00:00
|
|
|
}: {
|
|
|
|
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;
|
|
|
|
|
2024-01-06 16:30:35 +00:00
|
|
|
services.printing.drivers =
|
|
|
|
[
|
|
|
|
pkgs.gutenprint
|
|
|
|
]
|
|
|
|
++ (
|
|
|
|
if (pkgs.system == "x86_64-linux")
|
|
|
|
then [pkgs.cups-brother-hl3140cw]
|
|
|
|
else []
|
|
|
|
);
|
2024-01-06 09:46:10 +00:00
|
|
|
|
|
|
|
networking.hosts = flake.self.lib.addLocalHostname ["cups.local"];
|
2021-05-30 19:10:28 +00:00
|
|
|
|
2024-01-06 09:46:10 +00:00
|
|
|
services.caddy = {
|
|
|
|
enable = true;
|
|
|
|
extraConfig = ''
|
|
|
|
cups.local {
|
|
|
|
request_header Host localhost:631
|
|
|
|
reverse_proxy unix//run/cups/cups.sock
|
|
|
|
}
|
|
|
|
'';
|
2021-05-30 19:10:28 +00:00
|
|
|
};
|
|
|
|
}
|