Brother MFC-J5340DWE rpm or deb driver but nothing installable

Hi all

Can someone please help me? I’ve recently bought a Brother MFC-J5340DWE printer and although I could download a .deb or .rpm file for it and it works fine on OpenSUSE, I’m trying to switch to NixOS and having this issue. I’ve read previous threads and tried to follow previous instructions with git clone git@github.com:NixOS/nixpkgs.git but get an error saying permission denied. I can find the source for a similar printer but have no idea where to go from here. I can scan just fine using brscan5 but not print. Can someone please give me a simple, step-by-step guide to building/creating a package for it?

Here’s the source for the printer that’s similar

Pretty sure it supports Airprint, why do you want to use the driver? I’d just use IPP everywhere.

I don’t know how to get that to work, I did that for my previous printer and that worked but when I used the same config for the new one, it didn’t work.
I made a printer.nix file to import into my configuration.nix
I’ll attach here

{ config, lib, pkgs, modulesPath, ... }:

{
  imports =
    [ (modulesPath + "/installer/scan/not-detected.nix")
<nixpkgs/nixos/modules/services/hardware/sane_extra_backends/brscan5.nix>
    ];


# Enable Printer
hardware.printers = {
  ensureDefaultPrinter = "Brother";
  ensurePrinters = [{
    name = "Brother";
    location = "office";
    model = "everywhere";
ppdOptions = {
      pageSize = "A4";
    };
    description = "Brother MFC-J5340DW";
    deviceUri = "ipp://192.168.1.21/ipp";
  }];
};

# Enable Scanner
hardware = {
sane = {
enable = true;
brscan5 = {
enable = true;
netDevices = {
home = { model = "MFC-J5340DW"; ip = "192.168.1.21"; };
};
};
};
};

}

actually, I’ve just added this part

services.avahi = {
  enable = true;
  nssmdns4 = true;
  openFirewall = true;
};

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

and it’s working now, thanks for your help

You don’t need avahi if you have a static ip or hostname, you can just add the printer directly via that information.