Installing printer/scanner driver from RPM

Hello,

I’m considering buying a Brother MFC-J4540DWXL printer/scanner but since it’s quite recent I’m pretty sure I’ll have to install the drivers manually. They are available here: Brother MFC-J4540DWXL Drivere & Downloads | Brother

But how hard would is be to install them from .deb and .rpm packages? I downloaded and extracted the scanner driver already and it looks like there are a lot of files:

.
├── etc
│  └── opt
│     └── brother
│        └── scanner
│           └── brscan5
└── opt
   └── brother
      └── scanner
         └── brscan5
            ├── brsaneconfig5
            ├── brsanenetdevice.cfg
            ├── brscan5.ini
            ├── brscan_cnetconfig
            ├── brscan_gnetconfig
            ├── doc
            │  ├── LICENSE_ENG.txt
            │  ├── LICENSE_JPN.txt
            │  └── readme.txt
            ├── libLxBsDeviceAccs.so.1.0.0
            ├── libLxBsNetDevAccs.so.1.0.0
            ├── libLxBsScanCoreApi.so.3.2.0
            ├── libLxBsUsbDevAccs.so.1.0.0
            ├── libsane-brother5.so.1.0.7
            ├── models
            │  ├── brscan5ext_0.ini
            │  ├── brscan5ext_1.ini
            │  ├── brscan5ext_2.ini
            │  ├── brscan5ext_3.ini
            │  ├── brscan5ext_4.ini
            │  ├── brscan5ext_5.ini
            │  ├── brscan5ext_6.ini
            │  ├── brscan5ext_7.ini
            │  ├── brscan5ext_8.ini
            │  ├── brscan5ext_9.ini
            │  └── brscan5ext_10.ini
            ├── setupSaneScan5
            └── udev-rules
               ├── NN-brother-mfp-brscan5-1.0.2-2.rules
               └── udev_install

Having no experience with printers and little experience with nix, it looks a little complicated… Anyone has already done something like this? Are there packages I could look at for inspiration? Or is just a bad idea to buy that printer?

Are you sure you need to use that package? Modern printers tend to be supported by cups, which you can enable with services.printing.enable.

If it doesn’t support IPP, using a .deb won’t be trivial, but may be possible with buildFhsUserEnv and/or patchelf.

The scanner part is likely supported by the brscan5 driver which is available in NixOS (nixos-unstable):

  hardware.sane = {
    enable = true;
    brscan5.enable = true;
  };

For the printing part, I suggest using “IPP Everywhere” if possible.

Have a look at this: Brother DCP-572DW wrapper - #3 by peterhoeg