I wanted to add a soundfont to timidity for extra MIDI instruments. This is what I came up with:
pkgs.timidity.overrideAttrs (old: {
postInstall = ''
${old.postInstall}
chmod +w $out/share/timidity/timidity.cfg
echo 'soundfont ${pkgs.soundfont-fluid}/share/soundfonts/FluidR3_GM2-2.sf2' \
>> $out/share/timidity/timidity.cfg
'';
})
This works fine, but I am a bit surprised that I have to recompile timdidity in order to change its configuration file. Is there a better way to do this?