I was trying to automatically detect printers within CUPS, so I could use my parents’ printer during a visit. I think I am supposed to use Avahi to add .local hostname resolution so that this works. I followed the suggestions in this tweet, and it almost worked: I was able to add the printer, but I got an error about “.local” addresses not working when I tried to print. Now that I am home, the same setup seems to work just fine with my own printer.
First question set: Is there anything else I should have to do to make printer discovery work? Can someone help me understand why this didn’t work at my parents’ house?
While I was at my parents house, I further attempted to modify the file
/etc/nsswitch.conf by placing an entry in my
/etc/nixos/configuration.nix file (through the
environment.etc."nsswitch.conf" option), using an example I found online. However, after rebuilding my system, I found
/etc/nsswitch.conf contained my specified text for the file, followed by the text that had been there before. (Since my laptop has been rebooted since I returned home from my parents’ house, I am not sure if the reboot explains why printer discovery works for me at home, while it didn’t at my parents’.)
Second question: how am I supposed to edit /etc/nsswitch.conf? What causes this “prepending” behavior when I try to supply my own file?
In general, I am looking for help understanding how Avahi is supposed to work, and in particular getting my head around what it takes to be able to easily print to available printers on any network via CUPS. Any help will be appreciated.