Hp-setup crashes because it can't find a list of PPDs

Hi,

I’m trying to setup a scanner on my network and I am running into issues.
My printer/scanner is an HP DeskJet 3630 series.
In order to use it I followed the steps described in those wiki pages:
Printing - NixOS
Scanners - NixOS

And ended up with this addition to my /etc/nixos/configuration.nix:

# Printing  
services.printing.enable = true;
services.printing.drivers = [ pkgs.hplipWithPlugin ];
# Scanning
hardware.sane.enable = true;
hardware.sane.extraBackends = [ pkgs.hplipWithPlugin ];
hardware.sane.netConf = "192.168.1.10";

services.avahi.nssmdns = true;
services.avahi.reflector = true;

(I got the IP adress of my printer with arp -a)

The printing part works great with CUPS.

However, I can’t get the scanner to work.

when I run scanimage -L, (as a normal user or as root) I only see two webcams:

device `v4l:/dev/video2' is a Noname Integrated Camera: Integrated I virtual device
device `v4l:/dev/video0' is a Noname Integrated Camera: Integrated C virtual device

It is to be noted that the wiki page about scanners has a " Network scanning" section but it actually gives a workaround to add some backends I think ? Also it hasn’t been updated since 2017.

My next step was to try to use hp-setup as I did with all of my previous machines.
Again it can’t find my printer by scanning the the network, but if I use the manual connection and give it the IP arp gives me it tells me that it can indeed find a DeskJet 3630 there.

This is great but now I have another problem. It crashes because of some kind of path not existing ?
This is the output of hp-setup -g -i 192.1681.10:


HP Linux Imaging and Printing System (ver. 3.20.5)
Printer/Fax Setup Utility ver. 9.0

Copyright (c) 2001-18 HP Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

hp-setup[4949]: debug: param=192.168.1.10
hp-setup[4949]: debug: selected_device_name=None
(Note: Defaults for each question are maked with a '*'. Press <enter> to accept the default.)

hp-setup[4949]: debug: Cache miss: deskjet_3630_series
hp-setup[4949]: debug: Reading file: /nix/store/z2kziy1r4174d6in7z7zsyr0yc009kc8-hplip-3.20.5/share/hplip/data/models/models.dat
hp-setup[4949]: debug: Searching for section [deskjet_3630_series] in file /nix/store/z2kziy1r4174d6in7z7zsyr0yc009kc8-hplip-3.20.5/share/hplip/data/models/models.dat
hp-setup[4949]: debug: Found section [deskjet_3630_series] in file /nix/store/z2kziy1r4174d6in7z7zsyr0yc009kc8-hplip-3.20.5/share/hplip/data/models/models.dat

Setting up device: hp:/net/DeskJet_3630_series?ip=192.168.1.10


hp-setup[4949]: debug: Model=DeskJet_3630_series
hp-setup[4949]: debug: (CUPS 1.2.x) Getting list of PPDs using CUPS_GET_PPDS...
hp-setup[4949]: debug: CUPS PPD base path = None
hp-setup[4949]: debug: Foomatic PPD base path = /nix/store/z2kziy1r4174d6in7z7zsyr0yc009kc8-hplip-3.20.5/share/cups/model
Traceback (most recent call last):
  File "/nix/store/z2kziy1r4174d6in7z7zsyr0yc009kc8-hplip-3.20.5/share/hplip/setup.py", line 427, in <module>
    ppds = cups.getSystemPPDs()
  File "/nix/store/z2kziy1r4174d6in7z7zsyr0yc009kc8-hplip-3.20.5/share/hplip/prnt/cups.py", line 329, in getSystemPPDs
    path = os.path.join(cups_ppd_path, ppd)
  File "/nix/store/z65l1jqvxa58zzwwa3bvglb6asj4y8cv-python3-3.8.5/lib/python3.8/posixpath.py", line 76, in join
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType

It looks like the problem is that “CUPS PPD base path = None”. I am not a very technical user and I have no idea of the way to go from here. It might be a problem coming from hp-setup, in which case sorry to bother you but since it has something to do with paths I suspect that the nix-store might mess things up`.

I feel like it could still work, because When I look in the other mentioned path, I can find the ppd for my model: ls /nix/store/z2kziy1r4174d6in7z7zsyr0yc009kc8-hplip-3.20.5/share/cups/model/HP | grep deskjet_3630:

hp-deskjet_3630_series.ppd.gz

I am using the 20.09 branch of nix-pkgs.