Help configuring Brother MFC-L3770CDW printer for NixOS

Hello! I am struggling to set up my Brother MFC-L3770CDW printer for NixOS. Below is my config:

{ pkgs, ... }:
{
	services.avahi = {
		enable = true;
		nssmdns4 = true;
		openFirewall = true;
	};

	services.printing = {
		enable = true;
		drivers = with pkgs; [
			cups-filters
			cups-browsed
			mfcl3770cdwlpr
			mfcl3770cdwcupswrapper
			brgenml1lpr
			brgenml1cupswrapper
		];
	};

	hardware.printers = {
		ensurePrinters = [
			{
				name = "Brother_MFC_L3770CDW";
				location = "Home";
				deviceUri = "ipp://BRW8CC84B717AEC.local/ipp/print";
				model = "everywhere";
				# model = "brother_mfcl3770cdw_printer_en.ppd";
				# model = "brother-BrGenML1-cups-en.ppd";
			}
		];
		ensureDefaultPrinter = "Brother_MFC_L3770CDW";
	};
}

Relying entirely on CUPS discovery (before I chose to manually set up my printer) allowed rebuild switch to finish, but nothing can be printed– Firefox’s print option for the automatically detected printer was greyed out and LibreOffice lets you press print but it fails with a generic error message after idling for a while. Then, I attempted manually setting it up with the IP Everywhere protocol which was suggested in a lot of other posts like this, but then the rebuild-switch wouldn’t even compile.

Using IP Everywhere hangs at “starting the following units: ensure-printers.service” for a while then it gives an error message as shown below:

starting the following units: ensure-printers.service
Failed to start ensure-printers.service
warning: the following units failed: ensure-printers.service
× ensure-printers.service - Ensure NixOS-configured CUPS printers
     Loaded: loaded (/etc/systemd/system/ensure-printers.service; enabled; preset: ignored)
     Active: failed (Result: exit-code) since Wed 2026-07-08 13:35:03 EDT; 268ms ago
   Duration: 22min 5.470s
 Invocation: 8f04cca3cc874222a1864b39bf24f474
    Process: 27010 ExecStart=/nix/store/s34z5xcjv5i3rmapc9ynd4y70g9haxcg-unit-script-ensure-printers-start/bin/ensure-printers-start (code=exited, status
=1/FAILURE)
   Main PID: 27010 (code=exited, status=1/FAILURE)
         IP: 0B in, 0B out
         IO: 0B read, 40K written
   Mem peak: 2.4M
        CPU: 16ms

Jul 08 13:34:03 tpt14g5 systemd[1]: Starting Ensure NixOS-configured CUPS printers...
Jul 08 13:35:03 tpt14g5 ensure-printers-start[27013]: lpadmin: Connection timed out
Jul 08 13:35:03 tpt14g5 systemd[1]: ensure-printers.service: Main process exited, code=exited, status=1/FAILURE
Jul 08 13:35:03 tpt14g5 systemd[1]: ensure-printers.service: Failed with result 'exit-code'.
Jul 08 13:35:03 tpt14g5 systemd[1]: Failed to start Ensure NixOS-configured CUPS printers.
Command 'systemd-run -E LOCALE_ARCHIVE -E NIXOS_INSTALL_BOOTLOADER -E NIXOS_NO_CHECK --collect --no-ask-password --pipe --quiet --service-type=exec --uni
t=nixos-rebuild-switch-to-configuration /nix/store/ldmxxhsj833nnk2d6dd3d490qakyijk7-nixos-system-tpt14g5-26.11.20260705.d407951/bin/switch-to-configurati
on switch' returned non-zero exit status 4.

Finally, I individually attempted to use the two driver sets that are commented out. Rebuilding the system works without any issues. When I try to print something, there are no errors but the printer doesn’t print the documents. For now though, I am mainly interested in getting IP Everywhere to work so I don’t need drivers. If it helps, below is the output of the command avahi-browse -rt _ipp._tcp.

+ wlp0s20f3 IPv6 Brother MFC-L3770CDW series                   _ipp._tcp            local
+ wlp0s20f3 IPv4 Brother MFC-L3770CDW series                   _ipp._tcp            local
= wlp0s20f3 IPv6 Brother MFC-L3770CDW series                   _ipp._tcp            local
   hostname = [BRW8CC84B717AEC.local]
   address = [192.168.1.116]
   port = [631]
   txt = ["mopria-certified=1.3" "print_wfds=T" "UUID=e3248000-80ce-11db-8000-b42200021ef4" "PaperMax=legal-A4" "kind=document,envelope,label,postcard" "URF=SRGB24,W8,CP1,IS19-1,MT1-3-4-5-8-11,OB10,PQ4,RS600,V1.4,DM1" "rfo=ipp/faxout" "TBCP=F" "Transparent=T" "Binary=T" "PaperCustom=T" "Scan=T" "Fax=T" "Duplex=T" "Copies=T" "Color=T" "usb_CMD=PJL,PCL,PCLXL,URF" "usb_MDL=MFC-L3770CDW series" "usb_MFG=Brother" "priority=25" "adminurl=http://BRW8CC84B717AEC.local./net/net/airprint.html" "product=(Brother MFC-L3770CDW series)" "ty=Brother MFC-L3770CDW series" "note=" "rp=ipp/print" "pdl=application/octet-stream,image/urf,image/jpeg,image/pwg-raster" "qtotal=1" "txtvers=1"]
= wlp0s20f3 IPv4 Brother MFC-L3770CDW series                   _ipp._tcp            local
   hostname = [BRW8CC84B717AEC.local]
   address = [192.168.1.116]
   port = [631]
   txt = ["mopria-certified=1.3" "print_wfds=T" "UUID=e3248000-80ce-11db-8000-b42200021ef4" "PaperMax=legal-A4" "kind=document,envelope,label,postcard" "URF=SRGB24,W8,CP1,IS19-1,MT1-3-4-5-8-11,OB10,PQ4,RS600,V1.4,DM1" "rfo=ipp/faxout" "TBCP=F" "Transparent=T" "Binary=T" "PaperCustom=T" "Scan=T" "Fax=T" "Duplex=T" "Copies=T" "Color=T" "usb_CMD=PJL,PCL,PCLXL,URF" "usb_MDL=MFC-L3770CDW series" "usb_MFG=Brother" "priority=25" "adminurl=http://BRW8CC84B717AEC.local./net/net/airprint.html" "product=(Brother MFC-L3770CDW series)" "ty=Brother MFC-L3770CDW series" "note=" "rp=ipp/print" "pdl=application/octet-stream,image/urf,image/jpeg,image/pwg-raster" "qtotal=1" "txtvers=1"]

Any pointers to resolve this would be appreciated!

Did you look at the log of that service that failed to start?

The logs are already there. The connection times out. Did you try to ping the IP directly? Maybe using the IP works.

Hey, thanks for the response! Pinging both the direct IP and the hostname works (I truncated the output to save space).

~ ❯ ping BRW8CC84B717AEC.local -c 4
PING BRW8CC84B717AEC.local (192.168.1.116) 56(84) bytes of data.
64 bytes from BRW8CC84B717AEC.lan (192.168.1.116): icmp_seq=1 ttl=254 time=63.6 ms
64 bytes from BRW8CC84B717AEC.lan (192.168.1.116): icmp_seq=2 ttl=254 time=82.9 ms
64 bytes from BRW8CC84B717AEC.lan (192.168.1.116): icmp_seq=3 ttl=254 time=208 ms
64 bytes from BRW8CC84B717AEC.lan (192.168.1.116): icmp_seq=4 ttl=254 time=228 ms

--- BRW8CC84B717AEC.local ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 63.604/145.523/227.800/72.917 ms

~ ❯ ping 192.168.1.116 -c 4
PING 192.168.1.116 (192.168.1.116) 56(84) bytes of data.
64 bytes from 192.168.1.116: icmp_seq=1 ttl=254 time=322 ms
64 bytes from 192.168.1.116: icmp_seq=2 ttl=254 time=55.8 ms
64 bytes from 192.168.1.116: icmp_seq=3 ttl=254 time=68.9 ms
64 bytes from 192.168.1.116: icmp_seq=4 ttl=254 time=89.8 ms

--- 192.168.1.116 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3001ms
rtt min/avg/max/mdev = 55.823/134.119/321.982/109.135 ms

Replacing the hostname with the IP address in the deviceURI parameter in the printer module didn’t help, as running the rebuild switch command failed with the exact same error as shown in my original post.

If more logs can help, here is the output of systemctl status cups.service as I rebuild-switch, truncated down to just the relevant error messages.

Jul 09 13:44:48 tpt14g5 cupsd[83449]: Setting Brother_MFC_L3770CDW device-uri to "ipp://192.168.1.116/ipp/print" (was "file:///dev/null".)
Jul 09 13:44:48 tpt14g5 cupsd[83449]: Setting Brother_MFC_L3770CDW printer-is-accepting-jobs to 1 (was 0.)
Jul 09 13:44:48 tpt14g5 cupsd[83449]: Setting Brother_MFC_L3770CDW printer-state to 3 (was 5.)
Jul 09 13:45:07 tpt14g5 cupsd[83449]: Saving printers.conf...
Jul 09 13:45:07 tpt14g5 cupsd[83449]: Saving subscriptions.conf...
Jul 09 13:46:43 tpt14g5 cupsd[83449]: REQUEST localhost - - "POST /admin/ HTTP/1.1" 401 323 CUPS-Add-Modify-Printer successful-ok
Jul 09 13:46:43 tpt14g5 cupsd[83449]: Setting Brother_MFC_L3770CDW device-uri to "ipp://BRW8CC84B717AEC.local/ipp/print" (was "ipp://192.168.1.116/ipp/print".)
Jul 09 13:46:43 tpt14g5 cupsd[83449]: Setting Brother_MFC_L3770CDW printer-state to 3 (was 3.)
Jul 09 13:46:51 tpt14g5 cupsd[83449]: Brother_MFC_L3770CDW: PPD creation failed: No IPP attributes.
Jul 09 13:46:51 tpt14g5 cupsd[83449]: [Client 5] Returning IPP server-error-device-error for CUPS-Add-Modify-Printer (ipp://localhost:631/printers/Brother_MFC_L3770CDW) from localhost.

Something that jumps at me is that it says the printer has no IPP attributes?? Which strikes me as odd because 1. I believe most modern-ish printers should support it and 2. the avahi-browse command output as shown in my first post does indicate the printer should support it… but if not, what are some alternative addresses I can put in deviceUri?

Not sure if it will help, but does the printer show up / have additional info in the cups web admin page? Mine is at localhost:631.

Okay, so an update to the situation:

I was able to successfully connect to the printer and print test pages out, I did so by commenting out the entire hardware.printers module (to let cups-browsed do its thing) but keeping the printer-specific drivers. When I first tried the automatic browsing functionality on its own, I didn’t add said drivers which is why it was failing and I had felt the need to manually add the printer.

{ pkgs, ... }:
{
	services.avahi = {
		enable = true;
		nssmdns4 = true;
		openFirewall = true;
	};

	services.printing = {
		enable = true;
		drivers = with pkgs; [
			cups-filters
			cups-browsed
			mfcl3770cdwlpr
			mfcl3770cdwcupswrapper
		];
	};
}

However, I have another issue where when I print page from Firefox and select the black and white option, it still comes out colored. For LibreOffice, I don’t even see an option to print in black and white. How do I toggle between greyscale and colored printing?

Also, I am very new to internet forums in general; is this a situation where I would mark this post as solved and start a new one with this new issue? Or is it appropriate to continue on this thread given that the two issues are pretty closely related?

I’ve been struggling with Brother printers for decades, but I keep ending up with them. I found that installing the single brlaser package in the drivers list rather than specific drivers and cups packages solved the problems I had.