2023-01-28 20:49:10 +00:00
|
|
|
{
|
2023-11-10 18:48:06 +00:00
|
|
|
flake,
|
2023-01-28 20:49:10 +00:00
|
|
|
config,
|
|
|
|
pkgs,
|
2023-11-10 18:48:06 +00:00
|
|
|
lib,
|
2023-01-28 20:49:10 +00:00
|
|
|
...
|
2024-01-25 18:17:34 +00:00
|
|
|
}:
|
2024-06-13 00:14:25 +00:00
|
|
|
let
|
2024-01-25 18:17:34 +00:00
|
|
|
psCfg = config.pub-solar;
|
|
|
|
in {
|
2023-11-10 18:48:06 +00:00
|
|
|
services.avahi.enable = true;
|
|
|
|
services.avahi.ipv6 = true;
|
2024-04-18 10:57:14 +00:00
|
|
|
services.avahi.nssmdns4 = true;
|
2023-11-10 18:48:06 +00:00
|
|
|
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
|
2024-05-07 15:39:50 +00:00
|
|
|
pkgs.brlaser
|
2024-01-25 18:20:04 +00:00
|
|
|
];
|
2023-11-10 18:48:06 +00:00
|
|
|
|
2024-01-25 18:21:12 +00:00
|
|
|
hardware.sane = {
|
|
|
|
enable = true;
|
|
|
|
brscan5.enable = true;
|
|
|
|
};
|
|
|
|
|
2024-01-25 18:17:34 +00:00
|
|
|
users.users."${psCfg.user.name}" = {
|
|
|
|
extraGroups = ["lp" "scanner"];
|
|
|
|
};
|
|
|
|
|
2023-11-10 18:48:06 +00:00
|
|
|
networking.hosts = flake.self.lib.addLocalHostname ["cups.local"];
|
2021-05-30 19:10:28 +00:00
|
|
|
|
2024-07-15 17:04:19 +00:00
|
|
|
# Allow port 8612, used by sane-pixma(5) for scanner detection
|
|
|
|
networking.firewall.allowedTCPPorts = [ 8612 ];
|
|
|
|
|
2023-11-10 18:48:06 +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
|
|
|
};
|
|
|
|
}
|