anchor.diff:  
       services.udev.extraRules = nixosRules;
   
  -    services.udev.packages = [ extraUdevRules ];
  +    services.udev.packages = [ extraUdevRules extraHwdbFile ];
   
       services.udev.path = [ pkgs.coreutils pkgs.gnused pkgs.gnugrep pkgs.utillinux udev ];
   
       environment.etc =
         [ { source = udevRules;
             target = "udev/rules.d";
  +        }
  +        { source = hwdbBin;
  +          target = "udev/hwdb.bin";
           }
         ];
   
  
positive.code:           echo "" > /proc/sys/kernel/hotplug
          fi
  
          # Regenerate the hardware database /var/lib/udev/hwdb.bin
          # whenever systemd changes.
          if [ ! -e /var/lib/udev/prev-systemd -o "$(readlink /var/lib/udev/prev-systemd)" != ${config.systemd.package} ]; then
            echo "regenerating udev hardware database..."
            ${config.systemd.package}/bin/udevadm hwdb --update && ln -sfn ${config.systemd.package} /var/lib/udev/prev-systemd
          fi
  
          # Allow the kernel to find our firmware.
          if [ -e /sys/module/firmware_class/parameters/path ]; then
            echo -n "${config.hardware.firmware}/lib/firmware" > /sys/module/firmware_class/parameters/path
  
negative.code:     ''; # */
    };
  
    hwdbBin = stdenv.mkDerivation {
      name = "hwdb.bin";
  
      preferLocalBuild = true;
      allowSubstitutes = false;
  
      buildCommand = ''
        mkdir -p etc/udev/hwdb.d
        for i in ${toString ([udev] ++ cfg.packages)}; do
          echo "Adding hwdb files for package $i"
          for j in $i/{etc,lib}/udev/hwdb.d/*; do
            ln -s $j etc/udev/hwdb.d/$(basename $j)
          done
        done
  
        echo "Generating hwdb database..."
        ${udev}/bin/udevadm hwdb --update --root=$(pwd)
        mv etc/udev/hwdb.bin $out
      '';
    };
  
    # Udev has a 512-character limit for ENV{PATH}, so create a symlink
    # tree to work around this.
    udevPath = pkgs.buildEnv {
  