Adding soundfont for timidity requires rebuilding?

I wanted to add a soundfont to timidity for extra MIDI instruments. This is what I came up with:

pkgs.timidity.overrideAttrs (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?

Usually things like configuration files can be declared in nixos modules, i’ve just checked and there isn’t one for this package :-(. Raise an issue on the githubs, some kind soul might be interested in doing it, else if you feeling kind, do it yourself, and commit a PR!

1 Like

Thanks for the suggestion, I submitted a relevant module to home-manager: Appendix A. Configuration Options

1 Like