Brsaneconfig4 path error

Hi,

I’m trying to get my Brother DCP-L2550DN network scanner working.

I have installed brscan4 from the stable NixOS-19.09 repository, but when I try to use brsaneconfig4, I get this path error:

[tcip@nixos:~]$ sudo brsaneconfig4 -a name=SCANNER_DCPL2550DN model=DCP-L2550DN ip=192.168.0.10
sh: /etc/opt/brother/scanner/brscan4//brsanenetdevice4.cfg: No such file or directory

which is weird since I checked:

[tcip@nixos:~]$ which brsaneconfig4 
/run/current-system/sw/bin/brsaneconfig4

[tcip@nixos:~]$ locate brsanenetdevice4.cfg
/nix/store/15aw7hp8x74kwawqwa14lcb9spc4xh2k-brscan4-0.4.4-4/opt/brother/scanner/brscan4/brsanenetdevice4.cfg

[tcip@nixos:~]$ cat /run/current-system/sw/bin/brsaneconfig4 
#! /nix/store/506nnycf7nk22x7n07mjjjl2g8nifpda-bash-4.4-p23/bin/bash -e
export LD_PRELOAD='/nix/store/15aw7hp8x74kwawqwa14lcb9spc4xh2k-brscan4-0.4.4-4/libexec/brother/scanner/brscan4/libpreload.so'
exec "/nix/store/15aw7hp8x74kwawqwa14lcb9spc4xh2k-brscan4-0.4.4-4/opt/brother/scanner/brscan4/brsaneconfig4"  "${extraFlagsArray[@]}" "$@"

Any idea of what why the exec link is not the one used?

In case it might be useful, here is my system information:

          ::::.    ':::::     ::::'           tcip@nixos
          ':::::    ':::::.  ::::'            OS: NixOS 19.09.1457.dae3575cee5 (Loris)
            :::::     '::::.:::::             Kernel: x86_64 Linux 5.3.13
      .......:::::..... ::::::::              Uptime: 2h 48m
     ::::::::::::::::::. ::::::    ::::.      Packages: 1377
    ::::::::::::::::::::: :::::.  .::::'      Shell: bash 4.4.23
           .....           ::::' :::::'       Resolution: 1920x1080
          :::::            '::' :::::'        DE: KDE 5.61.0 / Plasma 5.16.5
 ........:::::               ' :::::::::::.   WM: KWin
:::::::::::::                 :::::::::::::   GTK Theme: Breeze [GTK2]
 ::::::::::: ..              :::::            Icon Theme: breeze
     .::::: .:::            :::::             Font: Sans Serif Regular
    .:::::  :::::          '''''    .....     CPU: Intel Core i7-7700 @ 8x 4.2GHz
    :::::   ':::::.  ......:::::::::::::'     GPU: i915drmfb
     :::     ::::::. ':::::::::::::::::'      RAM: 1977MiB / 15937MiB
            .:::::::: '::::::::::            
           .::::''::::.     '::::.           
          .::::'   ::::.     '::::.          
         .::::      ::::      '::::.  

Thanks and all the best,
Thomas

Hi @tcip. The brsaneconfig4 utility from this package was not intended to be used directly by the user on nixos system as it would involve performing mutations on part of the /etc directory which is incompatible with the nixos concept of a system whose configuration is the result of the application of a pure function on its inputs which is pretty much different from other distributions.

A nixos module has been provided just for that purpose which actually does use the utility nixpkgs/brscan4_etc_files.nix ln 27 in a intermediate derivation. It however configure the location of the target configuration file through the BRSANENETDEVICE4_CFG_FILENAME env var at nixpkgs/brscan4_etc_files.nix ln 52.

Here’s my own configuration:

  hardware.sane = {
    enable = true;
    brscan4.enable = true;

    brscan4.netDevices = {
      livingRoom = { model = "MFC-7860DW"; nodename = "BRW0080927AFBCE"; };
    };
  };

In you particular case, the configuration would be something like:

    brscan4.netDevices = {
      SCANNER_DCPL2550DN = { model = "DCP-L2550DN"; ip = "192.168.0.10"; };
    };

using an ip address instead of a hostname.

Documentation for options of this module can be found at Search NixOS options: “brscan”.

Hey @jraygauthier,

Thanks a lot for your answer and your work, that’s brililant! Of course, it had to have an option in the configuration file! I’m still amazed at how convenient and beautiful NixOS’s way of thinking is. That’s perfect for managing all my family’s computers and for my working needs :relieved:.

That makes me wonder, however. I suppose you configured your network printer in the same way, instead of – like me :disappointed: – doing it by hand in your desktop manager. Can you please share your network printing configuration?

All the best,