anchor.diff:        ensureDir $out
         ln -s ${nixRules} $out/${nixRules.name}
         shopt -s nullglob
  -      cp ${udev}/etc/udev/rules.d/*.rules $out/
  +      cp ${udev}/*/udev/rules.d/*.rules $out/
  +      
         ${if config.boot.hardwareScan then
           ''
             substituteInPlace $out/80-drivers.rules \
  
positive.code:     inherit firmwareDirs;
    };
      
    nixRules = writeText "10-nix.rules" ''
    
      # Miscellaneous devices.
      KERNEL=="sonypi",               MODE="0666"
      KERNEL=="kvm",                  MODE="0666"
      KERNEL=="kqemu",                NAME="%k", MODE="0666"
  
      # Create a symlink for the CD-ROM device.
      #KERNEL=="hd[a-z]", BUS=="ide", SYSFS{removable}=="1", SYSFS{device/media}=="cdrom", SYMLINK+="cdrom cdrom-%k"
      #KERNEL=="sr[0-9]", BUS=="scsi", SYMLINK+="cdrom cdrom-%k"
  
      # ALSA sound devices.
      KERNEL=="controlC[0-9]*",       NAME="snd/%k", MODE="${cfg.sndMode}"
      KERNEL=="hwC[D0-9]*",           NAME="snd/%k", MODE="${cfg.sndMode}"
  
negative.code:         ''
        }
        for i in ${toString extraUdevPkgs}; do
          for j in $i/*/udev/rules.d/*; do
            ln -s $j $out/$(basename $j)
          done
        done
  