NixOS/core/printing.nix

25 lines
887 B
Nix
Raw Normal View History

2023-12-15 19:10:28 +00:00
{ pkgs, lib, config, ... }:
let
settings = import ./../settings.nix;
in
{
config = lib.mkMerge [
{
services.printing.enable = true;
}
# Avahi daemon
(lib.mkIf settings.printing.avahi {
services.avahi.enable = true;
# for a WiFi printer
services.avahi.openFirewall = true;
services.avahi.nssmdns = false; # Use the settings from below
# settings from avahi-daemon.nix where mdns is replaced with mdns4
system.nssModules = pkgs.lib.optional (!config.services.avahi.nssmdns) pkgs.nssmdns;
system.nssDatabases.hosts = with pkgs.lib; optionals (!config.services.avahi.nssmdns) (mkMerge [
(mkBefore [ "mdns4_minimal [NOTFOUND=return]" ]) # before resolve
(mkAfter [ "mdns4" ]) # after dns
]);
})
];
2023-12-01 19:55:20 +00:00
}