Code change:
<ins> { lib , pkgs , alsa-lib , plugins ? [ pkgs.alsa-plugins ] , lndir , symlinkJoin , runCommand }: let merged = symlinkJoin { name = "alsa-plugins-merged"; paths = plugins; }; in runCommand "${alsa-lib.pname}-${alsa-lib.version}" { meta = with lib; { description = "wrapper to ease access to ALSA plugins"; platforms = platforms.linux; maintainers = with maintainers; [ gm6k ]; }; outputs = alsa-lib.outputs; } ( ( lib.concatMapStringsSep "n" ( output: '' mkdir ${builtins.placeholder output} ${lndir}/bin/lndir ${lib.attrByPath [output] null alsa-lib}  ${builtins.placeholder output} '' ) alsa-lib.outputs ) + '' cp -r ${merged}/lib/alsa-lib $out/lib ( echo $out | wc -c echo ${alsa-lib} | wc -c ) | xargs echo | grep -q "^(.*) 1$" || ( echo cannot binary patch exit 1 ) rm $out/lib/libasound.la rm $out/lib/libasound.so.?.?.? rm $dev/lib/pkgconfig/alsa.pc rm $dev/nix-support/propagated-build-inputs cp ${alsa-lib}/lib/libasound.la $out/lib cp ${alsa-lib}/lib/libasound.so.?.?.? $out/lib cp ${alsa-lib.dev}/lib/pkgconfig/alsa.pc $dev/lib/pkgconfig cp ${alsa-lib.dev}/nix-support/propagated-build-inputs $dev/nix-support sed -i  $out/lib/libasound.la  $out/lib/libasound.so.?.?.?  $dev/lib/pkgconfig/alsa.pc  $dev/nix-support/propagated-build-inputs  -e "s@${alsa-lib}@$out@g" '' ) </ins>

Related discussion:
text: I was thinking about integrating the alsaPlugins into the alsaLib derivation altogether. (I need the jack plugin as well) It may not be an elegant solution but it's not that big an overhead (maybe some dependencies will need adjustments) And build all the plugins that are buildable. Also I think the workaround was removed in official alsa project. See Dynamic Loader helpers section here:
I'm using this workaround right now:
Also see , which maybe adds more complexity to this issue because of a 32-bit library / 64-bit plugin mismatch.
(triage) status?
I think I'm seeing an effect of this in attempting to update the Factorio derivation, but master nixpkgs has a more up to date version of alsaLib, but it appears to be trying to load the plugins from the system installed version of alsaPlugins.
I also got hit by this issue while trying to run Nix-installed Audacity 2.2.2 (from nixpkgs master) on Ubuntu 14.04. Audacity playback doesn't make any sound because, it seems, hardcodes its plugin search directory.
I worked around this by creating a directory containing a symbolic link to and adding that directory to .
I've found a workaround in Guix manual alsaPlugins the following lines to ~/.asoundrc or
Wow. Thanks for the tip gnidorah <:
Still relevant in 19.09 :/ Does anyone know the syntax for importing rate conversion plugins ("speexrate", "samplerate", etc.) directly inside "", or if there's a method without hackery by now? Btw, seems to be affected by this, I'm using your workaround from here right now, together with .
Meanwhile it is even ALSAPLUGINDIR instead of ALSAPLUGINDIRS (notice the missing plural 'S')
we could patch like so. But beware, this is actually only for the the second time that i am patching c code. I tried it with and the converter and it's working so far. <details<summaryenvironment-plugin-</summary</details
Or we could just bring back the original patch.