In preparation for the deprecation of `stdenv.isX`.
These shorthands are not conducive to cross-compilation because they
hide the platforms.
Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way
One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059
There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.
```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
The nixpkgs-unstable channel's programs.sqlite was used to identify
packages producing exactly one binary, and these automatically added
to their package definitions wherever possible.
without patching.
Entries for these scanners are both in the doc/descriptions folder,
marked as unsupported by the epson2 backend, and in the doc/descriptions-external,
supported by the epkowa backend.
changelog: https://gitlab.com/sane-project/backends/-/tags/1.2.1
Tested by scanning in nixos-rebuild build-vm, which can be done by
passing your USB printer to the vm as follows:
QEMU_OPTS="-device usb-ehci,id=ehci -device usb-host,vendorid=0x1234,productid=0xabcd" result/bin/run-nixos-vm
where lsusb reports
Bus 003 Device 008: ID 1234:abcd The Printer
We used to ship the pre-computed udev rules that are distributed in the
tarballs. This is problematic as it changes the group of scanners to
scanner which removes the group lp and prevents cups from using it.
(https://github.com/NixOS/nixpkgs/issues/147217)
For this reason we switched to generating udev and hwdb files as follows:
./tools/sane-desc -m udev+hwdb -s doc/descriptions:doc/descriptions-external > $out/etc/udev/rules.d/49-libsane.rules
./tools/sane-desc -m udev+hwdb -s doc/descriptions -m hwdb > $out/etc/udev/hwdb.d/20-sane.hwdb
following what other distros do.
(https://github.com/NixOS/nixpkgs/pull/176412)
this is great, but sane-desc does not include unsupported .desc entries
like EPSON V300 PHOTO, which was present in the distributed udev rules.
So even when installing all the required unfree stuff to make the
corresponding epkowa backend work, it only works as root as there is no
corresponding hwdb entry. As the .desc entry contains the usb ids, we
can just patch sane-desc to generate hwdb entries even for unsupported
models.