anchor.diff:          ''
         }
         for i in ${toString extraUdevPkgs}; do
  -        for j in $i/etc/udev/rules.d/*; do
  +        for j in $i/*/udev/rules.d/*; do
             ln -s $j $out/$(basename $j)
           done
         done
  
positive.code:       ensureDir $out
        ln -s ${nixRules} $out/${nixRules.name}
        shopt -s nullglob
        cp ${udev}/etc/udev/rules.d/*.rules $out/
        ${if config.boot.hardwareScan then
          ''
            substituteInPlace $out/80-drivers.rules \
  
negative.code:     inherit firmwareDirs;
    };
      
    nixRules = writeText "90-nix.rules" ''
    
      # Miscellaneous devices.
      KERNEL=="sonypi",               MODE="0666"
      KERNEL=="kvm",                  MODE="0666"
      KERNEL=="kqemu",                NAME="%k", MODE="0666"
  
      # Create symlinks for CD/DVD devices.
      ACTION=="add", SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", SYMLINK+="cdrom cdrom-%k"
      ACTION=="add", SUBSYSTEM=="block", ENV{ID_CDROM_CD_RW}=="?*", SYMLINK+="cdrw cdrw-%k"
      ACTION=="add", SUBSYSTEM=="block", ENV{ID_CDROM_DVD}=="?*", SYMLINK+="dvd dvd-%k"
      ACTION=="add", SUBSYSTEM=="block", ENV{ID_CDROM_DVD_RW}=="?*", SYMLINK+="dvdrw dvdrw-%k"
      
      # ALSA sound devices.
      KERNEL=="controlC[0-9]*",       NAME="snd/%k", MODE="${cfg.sndMode}"
      KERNEL=="hwC[D0-9]*",           NAME="snd/%k", MODE="${cfg.sndMode}"
  