about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/audio
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/audio')
-rw-r--r--nixpkgs/pkgs/tools/audio/abcm2ps/default.nix33
-rw-r--r--nixpkgs/pkgs/tools/audio/abcmidi/default.nix23
-rw-r--r--nixpkgs/pkgs/tools/audio/accuraterip-checksum/default.nix31
-rw-r--r--nixpkgs/pkgs/tools/audio/acoustid-fingerprinter/default.nix33
-rw-r--r--nixpkgs/pkgs/tools/audio/acoustid-fingerprinter/ffmpeg.patch26
-rw-r--r--nixpkgs/pkgs/tools/audio/alsaequal/caps_9.x.patch21
-rw-r--r--nixpkgs/pkgs/tools/audio/alsaequal/default.nix43
-rw-r--r--nixpkgs/pkgs/tools/audio/alsaequal/false_error.patch13
-rw-r--r--nixpkgs/pkgs/tools/audio/alsaequal/makefile.patch13
-rw-r--r--nixpkgs/pkgs/tools/audio/audiowaveform/default.nix38
-rw-r--r--nixpkgs/pkgs/tools/audio/beets/badfiles-plugin-nix-paths.patch21
-rw-r--r--nixpkgs/pkgs/tools/audio/beets/bash-completion-always-print.patch43
-rw-r--r--nixpkgs/pkgs/tools/audio/beets/convert-plugin-ffmpeg-path.patch43
-rw-r--r--nixpkgs/pkgs/tools/audio/beets/default.nix302
-rw-r--r--nixpkgs/pkgs/tools/audio/beets/keyfinder-default-bin.patch26
-rw-r--r--nixpkgs/pkgs/tools/audio/beets/plugins/alternatives.nix25
-rw-r--r--nixpkgs/pkgs/tools/audio/beets/plugins/check-tests.patch17
-rw-r--r--nixpkgs/pkgs/tools/audio/beets/plugins/check.nix35
-rw-r--r--nixpkgs/pkgs/tools/audio/beets/plugins/copyartifacts.nix33
-rw-r--r--nixpkgs/pkgs/tools/audio/beets/plugins/extrafiles.nix30
-rw-r--r--nixpkgs/pkgs/tools/audio/beets/replaygain-default-ffmpeg.patch26
-rw-r--r--nixpkgs/pkgs/tools/audio/bpm-tools/default.nix43
-rw-r--r--nixpkgs/pkgs/tools/audio/darkice/default.nix37
-rw-r--r--nixpkgs/pkgs/tools/audio/darkice/fix-undeclared-memmove.patch13
-rw-r--r--nixpkgs/pkgs/tools/audio/dir2opus/default.nix35
-rw-r--r--nixpkgs/pkgs/tools/audio/essentia-extractor/default.nix41
-rw-r--r--nixpkgs/pkgs/tools/audio/ezstream/default.nix33
-rw-r--r--nixpkgs/pkgs/tools/audio/glyr/default.nix27
-rw-r--r--nixpkgs/pkgs/tools/audio/google-music-scripts/default.nix59
-rw-r--r--nixpkgs/pkgs/tools/audio/gvolicon/default.nix28
-rw-r--r--nixpkgs/pkgs/tools/audio/kaldi/default.nix88
-rw-r--r--nixpkgs/pkgs/tools/audio/liquidsoap/full.nix74
-rw-r--r--nixpkgs/pkgs/tools/audio/midicsv/default.nix22
-rw-r--r--nixpkgs/pkgs/tools/audio/mididings/default.nix38
-rw-r--r--nixpkgs/pkgs/tools/audio/mp3cat/default.nix34
-rw-r--r--nixpkgs/pkgs/tools/audio/mpd-mpris/default.nix34
-rw-r--r--nixpkgs/pkgs/tools/audio/mpdas/default.nix27
-rw-r--r--nixpkgs/pkgs/tools/audio/mpdcron/Gemfile2
-rw-r--r--nixpkgs/pkgs/tools/audio/mpdcron/Gemfile.lock15
-rw-r--r--nixpkgs/pkgs/tools/audio/mpdcron/default.nix37
-rw-r--r--nixpkgs/pkgs/tools/audio/mpdcron/gemset.nix23
-rw-r--r--nixpkgs/pkgs/tools/audio/mpdris2/default.nix55
-rw-r--r--nixpkgs/pkgs/tools/audio/mpdsync/default.nix24
-rw-r--r--nixpkgs/pkgs/tools/audio/opl3bankeditor/default.nix27
-rw-r--r--nixpkgs/pkgs/tools/audio/opl3bankeditor/opn2bankeditor.nix14
-rw-r--r--nixpkgs/pkgs/tools/audio/pa-applet/default.nix33
-rw-r--r--nixpkgs/pkgs/tools/audio/pasystray/default.nix42
-rw-r--r--nixpkgs/pkgs/tools/audio/pasystray/fix-wayland.patch34
-rw-r--r--nixpkgs/pkgs/tools/audio/picotts/default.nix24
-rw-r--r--nixpkgs/pkgs/tools/audio/playerctl/default.nix27
-rw-r--r--nixpkgs/pkgs/tools/audio/pnmixer/default.nix25
-rw-r--r--nixpkgs/pkgs/tools/audio/pulsemixer/default.nix35
-rw-r--r--nixpkgs/pkgs/tools/audio/qastools/default.nix24
-rw-r--r--nixpkgs/pkgs/tools/audio/trx/add_bctoolbox_ldlib.patch15
-rw-r--r--nixpkgs/pkgs/tools/audio/trx/default.nix28
-rw-r--r--nixpkgs/pkgs/tools/audio/tts/default.nix123
-rw-r--r--nixpkgs/pkgs/tools/audio/video2midi/default.nix35
-rw-r--r--nixpkgs/pkgs/tools/audio/volctl/default.nix56
-rw-r--r--nixpkgs/pkgs/tools/audio/volumeicon/default.nix24
59 files changed, 2230 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/audio/abcm2ps/default.nix b/nixpkgs/pkgs/tools/audio/abcm2ps/default.nix
new file mode 100644
index 000000000000..139d684fb671
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/abcm2ps/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchFromGitHub, pkgconfig, which, docutils, freetype, pango }:
+
+stdenv.mkDerivation rec {
+  pname = "abcm2ps";
+  version = "8.14.11";
+
+  src = fetchFromGitHub {
+    owner = "leesavide";
+    repo = "abcm2ps";
+    rev = "v${version}";
+    sha256 = "0lzzr2nkfg27gljcrdxkmli1wp08vap3vgxq1zgkv7f43rbm0qnw";
+  };
+
+  configureFlags = [
+    "--INSTALL=install"
+  ];
+
+  buildFlags = [
+    "CC=${stdenv.cc}/bin/cc"
+  ];
+
+  nativeBuildInputs = [ which pkgconfig docutils ];
+
+  buildInputs = [ freetype pango ];
+
+  meta = with stdenv.lib; {
+    homepage = "http://moinejf.free.fr/";
+    license = licenses.gpl3;
+    description = "A command line program which converts ABC to music sheet in PostScript or SVG format";
+    platforms = platforms.unix;
+    maintainers = [ maintainers.dotlambda ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/audio/abcmidi/default.nix b/nixpkgs/pkgs/tools/audio/abcmidi/default.nix
new file mode 100644
index 000000000000..e33ff98587bf
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/abcmidi/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchzip }:
+
+stdenv.mkDerivation rec {
+  pname = "abcMIDI";
+  version = "2020.11.07";
+
+  src = fetchzip {
+    url = "https://ifdo.ca/~seymour/runabc/${pname}-${version}.zip";
+    sha256 = "0zwzgqy1wa7yd2cm6spq11lw21mdn92lx8qzrxpk9kxcl03mv5jd";
+  };
+
+  # There is also a file called "makefile" which seems to be preferred by the standard build phase
+  makefile = "Makefile";
+
+  meta = with stdenv.lib; {
+    homepage = "http://abc.sourceforge.net/abcMIDI/";
+    downloadPage = "https://ifdo.ca/~seymour/runabc/top.html";
+    license = licenses.gpl2Plus;
+    description = "Utilities for converting between abc and MIDI";
+    platforms = platforms.unix;
+    maintainers = [ maintainers.dotlambda ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/audio/accuraterip-checksum/default.nix b/nixpkgs/pkgs/tools/audio/accuraterip-checksum/default.nix
new file mode 100644
index 000000000000..efd440256470
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/accuraterip-checksum/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchFromGitHub, libsndfile }:
+
+stdenv.mkDerivation rec {
+  pname = "accuraterip-checksum";
+  version = "1.5";
+
+  src = fetchFromGitHub {
+    owner = "leo-bogert";
+    repo = "accuraterip-checksum";
+    rev = "version${version}";
+    sha256 = "1a6biy78jb094rifazn4a2g1dlhryg5q8p8gwj0a60ipl0vfb9bj";
+  };
+
+  buildInputs = [ libsndfile ];
+
+  installPhase = ''
+    runHook preInstall
+
+    install -D -m755 accuraterip-checksum "$out/bin/accuraterip-checksum"
+
+    runHook postInstall
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Program for computing the AccurateRip checksum of singletrack WAV files";
+    homepage = "https://github.com/leo-bogert/accuraterip-checksum";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ ];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/audio/acoustid-fingerprinter/default.nix b/nixpkgs/pkgs/tools/audio/acoustid-fingerprinter/default.nix
new file mode 100644
index 000000000000..e2824bc07b66
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/acoustid-fingerprinter/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchurl, fetchpatch, cmake, pkgconfig, qt4, taglib, chromaprint, ffmpeg }:
+
+stdenv.mkDerivation rec {
+  pname = "acoustid-fingerprinter";
+  version = "0.6";
+
+  src = fetchurl {
+    url = "https://bitbucket.org/acoustid/acoustid-fingerprinter/downloads/"
+        + "${pname}-${version}.tar.gz";
+    sha256 = "0ckglwy95qgqvl2l6yd8ilwpd6qs7yzmj8g7lnxb50d12115s5n0";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ cmake qt4 taglib chromaprint ffmpeg ];
+
+  cmakeFlags = [ "-DTAGLIB_MIN_VERSION=${stdenv.lib.getVersion taglib}" ];
+
+  patches = [
+    (fetchpatch {
+      url = "https://bitbucket.org/acoustid/acoustid-fingerprinter/commits/632e87969c3a5562a5d4842b03613267ba6236b2/raw";
+      sha256 = "15hm9knrpqn3yqrwyjz4zh2aypwbcycd0c5svrsy1fb2h2rh05jk";
+    })
+    ./ffmpeg.patch
+  ];
+
+  meta = with stdenv.lib; {
+    homepage = "https://acoustid.org/fingerprinter";
+    description = "Audio fingerprinting tool using chromaprint";
+    license = stdenv.lib.licenses.gpl2Plus;
+    maintainers = with maintainers; [ ehmry ];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/audio/acoustid-fingerprinter/ffmpeg.patch b/nixpkgs/pkgs/tools/audio/acoustid-fingerprinter/ffmpeg.patch
new file mode 100644
index 000000000000..f3eacae26f77
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/acoustid-fingerprinter/ffmpeg.patch
@@ -0,0 +1,26 @@
+diff --git a/decoder.h b/decoder.h
+index 028f58f..4428ac1 100644
+--- a/decoder.h
++++ b/decoder.h
+@@ -39,6 +39,8 @@ extern "C" {
+ #define AV_SAMPLE_FMT_S16 SAMPLE_FMT_S16
+ #endif
+ 
++#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000
++
+ class Decoder
+ {
+ public:
+diff --git a/ffmpeg/audioconvert.h b/ffmpeg/audioconvert.h
+index 2b28e2e..a699986 100644
+--- a/ffmpeg/audioconvert.h
++++ b/ffmpeg/audioconvert.h
+@@ -79,7 +79,7 @@ int avcodec_channel_layout_num_channels(int64_t channel_layout);
+  * @param fmt_name Format name, or NULL if unknown
+  * @return Channel layout mask
+  */
+-uint64_t avcodec_guess_channel_layout(int nb_channels, enum CodecID codec_id, const char *fmt_name);
++uint64_t avcodec_guess_channel_layout(int nb_channels, enum AVCodecID codec_id, const char *fmt_name);
+ 
+ struct AVAudioConvert;
+ typedef struct AVAudioConvert AVAudioConvert;
diff --git a/nixpkgs/pkgs/tools/audio/alsaequal/caps_9.x.patch b/nixpkgs/pkgs/tools/audio/alsaequal/caps_9.x.patch
new file mode 100644
index 000000000000..282e04049747
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/alsaequal/caps_9.x.patch
@@ -0,0 +1,21 @@
+--- ./ctl_equal.c
++++ ./ctl_equal.c
+@@ -167,7 +167,7 @@
+ 	snd_ctl_equal_t *equal;
+ 	const char *controls = ".alsaequal.bin";
+ 	const char *library = "/usr/lib/ladspa/caps.so";
+-	const char *module = "Eq";
++	const char *module = "Eq10";
+ 	long channels = 2;
+ 	const char *sufix = " Playback Volume";
+ 	int err, i, index;
+--- ./pcm_equal.c
++++ ./pcm_equal.c
+@@ -151,7 +151,7 @@
+ 	snd_config_t *sconf = NULL;
+ 	const char *controls = ".alsaequal.bin";
+ 	const char *library = "/usr/lib/ladspa/caps.so";
+-	const char *module = "Eq";
++	const char *module = "Eq10";
+ 	long channels = 2;
+ 	int err;
diff --git a/nixpkgs/pkgs/tools/audio/alsaequal/default.nix b/nixpkgs/pkgs/tools/audio/alsaequal/default.nix
new file mode 100644
index 000000000000..9498baca991b
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/alsaequal/default.nix
@@ -0,0 +1,43 @@
+{ stdenv, fetchurl
+, alsaLib, caps
+}:
+
+stdenv.mkDerivation rec {
+  name = "alsaequal";
+  version = "0.6";
+
+  src = fetchurl {
+    url = "https://thedigitalmachine.net/tools/alsaequal-${version}.tar.bz2";
+    sha256 = "1w3g9q5z3nrn3mwdhaq6zsg0jila8d102dgwgrhj9vfx58apsvli";
+  };
+
+  buildInputs = [ alsaLib ];
+
+  makeFlags = [ "DESTDIR=$(out)" ];
+
+  # Borrowed from Arch Linux's AUR
+  patches = [
+    # Adds executable permissions to resulting libraries
+    # and changes their destination directory from "usr/lib/alsa-lib" to "lib/alsa-lib" to better align with nixpkgs filesystem hierarchy.
+    ./makefile.patch
+    # Fixes control port check, which resulted in false error.
+    ./false_error.patch
+    # Fixes name change of an "Eq" to "Eq10" method in version 9 of caps library.
+    ./caps_9.x.patch
+  ];
+
+  postPatch = ''
+    sed -i 's#/usr/lib/ladspa/caps\.so#${caps}/lib/ladspa/caps\.so#g' ctl_equal.c pcm_equal.c
+  '';
+
+  preInstall = ''
+    mkdir -p "$out/lib/alsa-lib"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Real-time adjustable equalizer plugin for ALSA";
+    homepage = "https://thedigitalmachine.net/alsaequal.html";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ ymeister ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/audio/alsaequal/false_error.patch b/nixpkgs/pkgs/tools/audio/alsaequal/false_error.patch
new file mode 100644
index 000000000000..1a8413da2741
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/alsaequal/false_error.patch
@@ -0,0 +1,13 @@
+--- ./ctl_equal.c
++++ ./ctl_equal.c
+@@ -263,8 +263,8 @@
+ 	for(i = 0; i < equal->num_input_controls; i++) {
+ 		if(equal->control_data->control[i].type == LADSPA_CNTRL_INPUT) {
+ 			index = equal->control_data->control[i].index;
+-			if(equal->klass->PortDescriptors[index] !=
+-					(LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL)) {
++			if(equal->klass->PortDescriptors[index] &
++					(LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL) == 0) {
+ 				SNDERR("Problem with control file %s, %d.", controls, index);
+ 				return -1;
+ 			}
diff --git a/nixpkgs/pkgs/tools/audio/alsaequal/makefile.patch b/nixpkgs/pkgs/tools/audio/alsaequal/makefile.patch
new file mode 100644
index 000000000000..ee8aa170d60b
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/alsaequal/makefile.patch
@@ -0,0 +1,13 @@
+--- ./Makefile
++++ ./Makefile
+@@ -45,8 +45,8 @@
+
+ install: all
+ 	@echo Installing...
+-	$(Q)install -m 644 $(SND_PCM_BIN) ${DESTDIR}/usr/lib/alsa-lib/
+-	$(Q)install -m 644 $(SND_CTL_BIN) ${DESTDIR}/usr/lib/alsa-lib/
++	$(Q)install -m 755 $(SND_PCM_BIN) ${DESTDIR}/lib/alsa-lib/
++	$(Q)install -m 755 $(SND_CTL_BIN) ${DESTDIR}/lib/alsa-lib/
+
+ uninstall:
+ 	@echo Un-installing...
diff --git a/nixpkgs/pkgs/tools/audio/audiowaveform/default.nix b/nixpkgs/pkgs/tools/audio/audiowaveform/default.nix
new file mode 100644
index 000000000000..9d674dcfe436
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/audiowaveform/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchFromGitHub, cmake, gtest, boost, gd, libsndfile, libmad, libid3tag }:
+
+stdenv.mkDerivation rec {
+  pname = "audiowaveform";
+  version = "1.4.2";
+
+  src = fetchFromGitHub {
+    owner = "bbc";
+    repo = "audiowaveform";
+    rev = version;
+    sha256 = "0k2s2f2hgq4pnjzfkgvjwgsflihmzdq7shicfjn0z2mzw4d1bvp2";
+  };
+
+  nativeBuildInputs = [ cmake gtest ];
+
+  buildInputs = [ boost gd libsndfile libmad libid3tag ];
+
+  preConfigure = ''
+    ln -s ${gtest.src}/googletest googletest
+    ln -s ${gtest.src}/googlemock googlemock
+  '';
+
+  # One test is failing, see PR #101947
+  doCheck = false;
+
+  meta = with stdenv.lib; {
+    description = "C++ program to generate waveform data and render waveform images from audio files";
+    longDescription = ''
+      audiowaveform is a C++ command-line application that generates waveform data from either MP3, WAV, FLAC, or Ogg Vorbis format audio files.
+      Waveform data can be used to produce a visual rendering of the audio, similar in appearance to audio editing applications.
+    '';
+    homepage = "https://github.com/bbc/audiowaveform";
+    changelog = "https://github.com/bbc/audiowaveform/blob/${version}/ChangeLog";
+    license = licenses.gpl3Plus;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ edbentley ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/audio/beets/badfiles-plugin-nix-paths.patch b/nixpkgs/pkgs/tools/audio/beets/badfiles-plugin-nix-paths.patch
new file mode 100644
index 000000000000..6956183344c4
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/beets/badfiles-plugin-nix-paths.patch
@@ -0,0 +1,21 @@
+diff --git i/beetsplug/badfiles.py w/beetsplug/badfiles.py
+index 36b45de3..5208b696 100644
+--- i/beetsplug/badfiles.py
++++ w/beetsplug/badfiles.py
+@@ -71,14 +71,14 @@ class BadFiles(BeetsPlugin):
+         return status, errors, [line for line in output.split("\n") if line]
+ 
+     def check_mp3val(self, path):
+-        status, errors, output = self.run_command(["mp3val", path])
++        status, errors, output = self.run_command(["@mp3val@/bin/mp3val", path])
+         if status == 0:
+             output = [line for line in output if line.startswith("WARNING:")]
+             errors = len(output)
+         return status, errors, output
+ 
+     def check_flac(self, path):
+-        return self.run_command(["flac", "-wst", path])
++        return self.run_command(["@flac@/bin/flac", "-wst", path])
+ 
+     def check_custom(self, command):
+         def checker(path):
diff --git a/nixpkgs/pkgs/tools/audio/beets/bash-completion-always-print.patch b/nixpkgs/pkgs/tools/audio/beets/bash-completion-always-print.patch
new file mode 100644
index 000000000000..7bc3e57117e3
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/beets/bash-completion-always-print.patch
@@ -0,0 +1,43 @@
+diff --git i/beets/ui/commands.py w/beets/ui/commands.py
+index 4d010f4b..0b023585 100755
+--- i/beets/ui/commands.py
++++ w/beets/ui/commands.py
+@@ -1741,20 +1741,6 @@ default_commands.append(config_cmd)
+ def print_completion(*args):
+     for line in completion_script(default_commands + plugins.commands()):
+         print_(line, end=u'')
+-    if not any(map(os.path.isfile, BASH_COMPLETION_PATHS)):
+-        log.warning(u'Warning: Unable to find the bash-completion package. '
+-                    u'Command line completion might not work.')
+-
+-BASH_COMPLETION_PATHS = map(syspath, [
+-    u'/etc/bash_completion',
+-    u'/usr/share/bash-completion/bash_completion',
+-    u'/usr/local/share/bash-completion/bash_completion',
+-    # SmartOS
+-    u'/opt/local/share/bash-completion/bash_completion',
+-    # Homebrew (before bash-completion2)
+-    u'/usr/local/etc/bash_completion',
+-])
+-
+ 
+ def completion_script(commands):
+     """Yield the full completion shell script as strings.
+diff --git i/test/test_ui.py w/test/test_ui.py
+index 5cfed1fd..9d3dc458 100644
+--- i/test/test_ui.py
++++ w/test/test_ui.py
+@@ -1230,12 +1230,7 @@ class CompletionTest(_common.TestCase, TestHelper):
+                                   stdout=subprocess.PIPE, env=env)
+ 
+         # Load bash_completion library.
+-        for path in commands.BASH_COMPLETION_PATHS:
+-            if os.path.exists(util.syspath(path)):
+-                bash_completion = path
+-                break
+-        else:
+-            self.skipTest(u'bash-completion script not found')
++        self.skipTest(u'bash-completion script not found')
+         try:
+             with open(util.syspath(bash_completion), 'rb') as f:
+                 tester.stdin.writelines(f)
diff --git a/nixpkgs/pkgs/tools/audio/beets/convert-plugin-ffmpeg-path.patch b/nixpkgs/pkgs/tools/audio/beets/convert-plugin-ffmpeg-path.patch
new file mode 100644
index 000000000000..bcc77179d796
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/beets/convert-plugin-ffmpeg-path.patch
@@ -0,0 +1,43 @@
+diff --git i/beetsplug/convert.py w/beetsplug/convert.py
+index 70363f6e..2962aa4f 100644
+--- i/beetsplug/convert.py
++++ w/beetsplug/convert.py
+@@ -81,7 +81,7 @@ def get_format(fmt=None):
+         command = config['convert']['command'].as_str()
+     elif 'opts' in keys:
+         # Undocumented option for backwards compatibility with < 1.3.1.
+-        command = u'ffmpeg -i $source -y {0} $dest'.format(
++        command = u'@ffmpeg@/bin/ffmpeg -i $source -y {0} $dest'.format(
+             config['convert']['opts'].as_str()
+         )
+     if 'extension' in keys:
+@@ -121,22 +121,22 @@ class ConvertPlugin(BeetsPlugin):
+             u'id3v23': u'inherit',
+             u'formats': {
+                 u'aac': {
+-                    u'command': u'ffmpeg -i $source -y -vn -acodec aac '
++                    u'command': u'@ffmpeg@/bin/ffmpeg -i $source -y -vn -acodec aac '
+                                 u'-aq 1 $dest',
+                     u'extension': u'm4a',
+                 },
+                 u'alac': {
+-                    u'command': u'ffmpeg -i $source -y -vn -acodec alac $dest',
++                    u'command': u'@ffmpeg@/bin/ffmpeg -i $source -y -vn -acodec alac $dest',
+                     u'extension': u'm4a',
+                 },
+-                u'flac': u'ffmpeg -i $source -y -vn -acodec flac $dest',
+-                u'mp3': u'ffmpeg -i $source -y -vn -aq 2 $dest',
++                u'flac': u'@ffmpeg@/bin/ffmpeg -i $source -y -vn -acodec flac $dest',
++                u'mp3': u'@ffmpeg@/bin/ffmpeg -i $source -y -vn -aq 2 $dest',
+                 u'opus':
+-                    u'ffmpeg -i $source -y -vn -acodec libopus -ab 96k $dest',
++                    u'@ffmpeg@/bin/ffmpeg -i $source -y -vn -acodec libopus -ab 96k $dest',
+                 u'ogg':
+-                    u'ffmpeg -i $source -y -vn -acodec libvorbis -aq 3 $dest',
++                    u'@ffmpeg@/bin/ffmpeg -i $source -y -vn -acodec libvorbis -aq 3 $dest',
+                 u'wma':
+-                    u'ffmpeg -i $source -y -vn -acodec wmav2 -vn $dest',
++                    u'@ffmpeg@/bin/ffmpeg -i $source -y -vn -acodec wmav2 -vn $dest',
+             },
+             u'max_bitrate': 500,
+             u'auto': False,
diff --git a/nixpkgs/pkgs/tools/audio/beets/default.nix b/nixpkgs/pkgs/tools/audio/beets/default.nix
new file mode 100644
index 000000000000..f72692c845c7
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/beets/default.nix
@@ -0,0 +1,302 @@
+{ stdenv, lib, fetchFromGitHub, writeScript, glibcLocales, diffPlugins, substituteAll
+, pythonPackages, imagemagick, gobject-introspection, gst_all_1
+, runtimeShell
+, fetchpatch
+
+# Attributes needed for tests of the external plugins
+, callPackage, beets
+
+, enableAbsubmit         ? lib.elem stdenv.hostPlatform.system essentia-extractor.meta.platforms, essentia-extractor ? null
+, enableAcousticbrainz   ? true
+, enableAcoustid         ? true
+, enableBadfiles         ? true, flac ? null, mp3val ? null
+, enableBeatport         ? true
+, enableBpsync           ? true
+, enableConvert          ? true, ffmpeg ? null
+, enableDeezer           ? true
+, enableDiscogs          ? true
+, enableEmbyupdate       ? true
+, enableFetchart         ? true
+, enableGmusic           ? true
+, enableKeyfinder        ? true, keyfinder-cli ? null
+, enableKodiupdate       ? true
+, enableLastfm           ? true
+, enableLoadext          ? true
+, enableMpd              ? true
+, enablePlaylist         ? true
+, enableReplaygain       ? true
+, enableSonosUpdate      ? true
+, enableSubsonicplaylist ? true
+, enableSubsonicupdate   ? true
+, enableThumbnails       ? true
+, enableWeb              ? true
+
+# External plugins
+, enableAlternatives     ? false
+, enableCheck            ? false, liboggz ? null
+, enableCopyArtifacts    ? false
+, enableExtraFiles       ? false
+
+, bashInteractive, bash-completion
+}:
+
+assert enableAbsubmit    -> essentia-extractor               != null;
+assert enableAcoustid    -> pythonPackages.pyacoustid        != null;
+assert enableBadfiles    -> flac != null && mp3val != null;
+assert enableBeatport    -> pythonPackages.requests_oauthlib != null;
+assert enableBpsync      -> enableBeatport;
+assert enableCheck       -> flac != null && mp3val != null && liboggz != null;
+assert enableConvert     -> ffmpeg                         != null;
+assert enableDiscogs     -> pythonPackages.discogs_client    != null;
+assert enableFetchart    -> pythonPackages.responses         != null;
+assert enableGmusic      -> pythonPackages.gmusicapi         != null;
+assert enableKeyfinder   -> keyfinder-cli                    != null;
+assert enableLastfm      -> pythonPackages.pylast            != null;
+assert enableMpd         -> pythonPackages.mpd2              != null;
+assert enableReplaygain  -> ffmpeg                         != null;
+assert enableSonosUpdate -> pythonPackages.soco              != null;
+assert enableThumbnails  -> pythonPackages.pyxdg             != null;
+assert enableWeb         -> pythonPackages.flask             != null;
+
+with lib;
+
+let
+  optionalPlugins = {
+    absubmit = enableAbsubmit;
+    acousticbrainz = enableAcousticbrainz;
+    badfiles = enableBadfiles;
+    beatport = enableBeatport;
+    bpsync = enableBpsync;
+    chroma = enableAcoustid;
+    convert = enableConvert;
+    deezer = enableDeezer;
+    discogs = enableDiscogs;
+    embyupdate = enableEmbyupdate;
+    fetchart = enableFetchart;
+    gmusic = enableGmusic;
+    keyfinder = enableKeyfinder;
+    kodiupdate = enableKodiupdate;
+    lastgenre = enableLastfm;
+    lastimport = enableLastfm;
+    loadext = enableLoadext;
+    mpdstats = enableMpd;
+    mpdupdate = enableMpd;
+    playlist = enablePlaylist;
+    replaygain = enableReplaygain;
+    sonosupdate = enableSonosUpdate;
+    subsonicplaylist = enableSubsonicplaylist;
+    subsonicupdate = enableSubsonicupdate;
+    thumbnails = enableThumbnails;
+    web = enableWeb;
+  };
+
+  pluginsWithoutDeps = [
+    "bench" "bpd" "bpm" "bucket" "cue" "duplicates" "edit" "embedart"
+    "export" "filefilter" "fish" "freedesktop" "fromfilename" "ftintitle" "fuzzy"
+    "hook" "ihate" "importadded" "importfeeds" "info" "inline" "ipfs" "lyrics"
+    "mbcollection" "mbsubmit" "mbsync" "metasync" "missing" "parentwork" "permissions" "play"
+    "plexupdate" "random" "rewrite" "scrub" "smartplaylist" "spotify" "the"
+    "types" "unimported" "zero"
+  ];
+
+  enabledOptionalPlugins = attrNames (filterAttrs (_: id) optionalPlugins);
+
+  allPlugins = pluginsWithoutDeps ++ attrNames optionalPlugins;
+  allEnabledPlugins = pluginsWithoutDeps ++ enabledOptionalPlugins;
+
+  testShell = "${bashInteractive}/bin/bash --norc";
+  completion = "${bash-completion}/share/bash-completion/bash_completion";
+
+  # This is a stripped down beets for testing of the external plugins.
+  externalTestArgs.beets = (beets.override {
+    enableAlternatives = false;
+    enableCopyArtifacts = false;
+    enableExtraFiles = false;
+  }).overrideAttrs (const {
+    doInstallCheck = false;
+  });
+
+  pluginArgs = externalTestArgs // { inherit pythonPackages; };
+
+  plugins = {
+    alternatives = callPackage ./plugins/alternatives.nix pluginArgs;
+    check = callPackage ./plugins/check.nix pluginArgs;
+    copyartifacts = callPackage ./plugins/copyartifacts.nix pluginArgs;
+    extrafiles = callPackage ./plugins/extrafiles.nix pluginArgs;
+  };
+
+in pythonPackages.buildPythonApplication rec {
+  pname = "beets";
+  # While there is a stable version, 1.4.9, it is more than 1000 commits behind
+  # master and lacks many bug fixes and improvements[1]. Also important,
+  # unstable does not require bs1770gain[2].
+  # [1]: https://discourse.beets.io/t/forming-a-beets-core-team/639
+  # [2]: https://github.com/NixOS/nixpkgs/pull/90504
+  version = "unstable-2020-12-22";
+
+  src = fetchFromGitHub {
+    owner = "beetbox";
+    repo = "beets";
+    rev = "53dcb24d10788897f20c341774b474808ec2c0b6";
+    sha256 = "sha256-P++NA13T2TRHW3Se10np8BSe/WRBYAKRte5xKoHKW50=";
+  };
+
+  propagatedBuildInputs = [
+    pythonPackages.six
+    pythonPackages.enum34
+    pythonPackages.jellyfish
+    pythonPackages.munkres
+    pythonPackages.musicbrainzngs
+    pythonPackages.mutagen
+    pythonPackages.pyyaml
+    pythonPackages.unidecode
+    pythonPackages.gst-python
+    pythonPackages.pygobject3
+    pythonPackages.reflink
+    pythonPackages.confuse
+    pythonPackages.mediafile
+    gobject-introspection
+  ] ++ optional enableAbsubmit      essentia-extractor
+    ++ optional enableAcoustid      pythonPackages.pyacoustid
+    ++ optional enableBeatport      pythonPackages.requests_oauthlib
+    ++ optional (enableFetchart
+              || enableDeezer
+              || enableEmbyupdate
+              || enableKodiupdate
+              || enableLoadext
+              || enablePlaylist
+              || enableSubsonicplaylist
+              || enableSubsonicupdate
+              || enableAcousticbrainz)
+                                    pythonPackages.requests
+    ++ optional enableCheck         plugins.check
+    ++ optional enableConvert       ffmpeg
+    ++ optional enableDiscogs       pythonPackages.discogs_client
+    ++ optional enableGmusic        pythonPackages.gmusicapi
+    ++ optional enableKeyfinder     keyfinder-cli
+    ++ optional enableLastfm        pythonPackages.pylast
+    ++ optional enableMpd           pythonPackages.mpd2
+    ++ optional enableSonosUpdate   pythonPackages.soco
+    ++ optional enableThumbnails    pythonPackages.pyxdg
+    ++ optional enableWeb           pythonPackages.flask
+    ++ optional enableAlternatives  plugins.alternatives
+    ++ optional enableCopyArtifacts plugins.copyartifacts
+    ++ optional enableExtraFiles    plugins.extrafiles
+  ;
+
+  buildInputs = [
+    imagemagick
+  ] ++ (with gst_all_1; [
+    gst-plugins-base
+    gst-plugins-good
+    gst-plugins-ugly
+  ]);
+
+  checkInputs = with pythonPackages; [
+    beautifulsoup4
+    mock
+    nose
+    rarfile
+    responses
+    # Although considered as plugin dependencies, they are needed for the
+    # tests, for disabling them via an override makes the build fail. see:
+    # https://github.com/beetbox/beets/blob/v1.4.9/setup.py
+    pylast
+    mpd2
+    discogs_client
+    pyxdg
+  ];
+
+  patches = [
+    # Bash completion fix for Nix
+    ./bash-completion-always-print.patch
+    # From some reason upstream assumes the program 'keyfinder-cli' is located
+    # in the path as `KeyFinder`
+    ./keyfinder-default-bin.patch
+  ]
+    # We need to force ffmpeg as the default, since we do not package
+    # bs1770gain, and set the absolute path there, to avoid impurities.
+    ++ lib.optional enableReplaygain (substituteAll {
+      src = ./replaygain-default-ffmpeg.patch;
+      ffmpeg = getBin ffmpeg;
+    })
+    # Put absolute Nix paths in place
+    ++ lib.optional enableConvert (substituteAll {
+      src = ./convert-plugin-ffmpeg-path.patch;
+      ffmpeg = getBin ffmpeg;
+    })
+    ++ lib.optional enableBadfiles (substituteAll {
+      src = ./badfiles-plugin-nix-paths.patch;
+      inherit mp3val flac;
+    })
+  ;
+
+  # Disable failing tests
+  postPatch = ''
+    sed -i -e '/assertIn.*item.*path/d' test/test_info.py
+    echo echo completion tests passed > test/rsrc/test_completion.sh
+
+    sed -i -e 's/len(mf.images)/0/' test/test_zero.py
+  '';
+
+  postInstall = ''
+    mkdir -p $out/share/zsh/site-functions
+    cp extra/_beet $out/share/zsh/site-functions/
+  '';
+
+  doCheck = true;
+
+  preCheck = ''
+    find beetsplug -mindepth 1 \
+      \! -path 'beetsplug/__init__.py' -a \
+      \( -name '*.py' -o -path 'beetsplug/*/__init__.py' \) -print \
+      | sed -n -re 's|^beetsplug/([^/.]+).*|\1|p' \
+      | sort -u > plugins_available
+
+     ${diffPlugins allPlugins "plugins_available"}
+  '';
+
+  checkPhase = ''
+    runHook preCheck
+
+    LANG=en_US.UTF-8 \
+    LOCALE_ARCHIVE=${assert stdenv.isLinux; glibcLocales}/lib/locale/locale-archive \
+    BEETS_TEST_SHELL="${testShell}" \
+    BASH_COMPLETION_SCRIPT="${completion}" \
+    HOME="$(mktemp -d)" nosetests -v
+
+    runHook postCheck
+  '';
+
+  doInstallCheck = true;
+
+  installCheckPhase = ''
+    runHook preInstallCheck
+
+    tmphome="$(mktemp -d)"
+
+    EDITOR="${writeScript "beetconfig.sh" ''
+      #!${runtimeShell}
+      cat > "$1" <<CFG
+      plugins: ${concatStringsSep " " allEnabledPlugins}
+      CFG
+    ''}" HOME="$tmphome" "$out/bin/beet" config -e
+    EDITOR=true HOME="$tmphome" "$out/bin/beet" config -e
+
+    runHook postInstallCheck
+  '';
+
+  makeWrapperArgs = [ "--set GI_TYPELIB_PATH \"$GI_TYPELIB_PATH\"" "--set GST_PLUGIN_SYSTEM_PATH_1_0 \"$GST_PLUGIN_SYSTEM_PATH_1_0\"" ];
+
+  passthru = {
+    externalPlugins = plugins;
+  };
+
+  meta = {
+    description = "Music tagger and library organizer";
+    homepage = "http://beets.io";
+    license = licenses.mit;
+    maintainers = with maintainers; [ aszlig domenkozar doronbehar lovesegfault pjones ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/audio/beets/keyfinder-default-bin.patch b/nixpkgs/pkgs/tools/audio/beets/keyfinder-default-bin.patch
new file mode 100644
index 000000000000..ec6bc3a5561c
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/beets/keyfinder-default-bin.patch
@@ -0,0 +1,26 @@
+diff --git a/beetsplug/keyfinder.py b/beetsplug/keyfinder.py
+index 702003f0..08689cd8 100644
+--- a/beetsplug/keyfinder.py
++++ b/beetsplug/keyfinder.py
+@@ -31,7 +31,7 @@ class KeyFinderPlugin(BeetsPlugin):
+     def __init__(self):
+         super(KeyFinderPlugin, self).__init__()
+         self.config.add({
+-            u'bin': u'KeyFinder',
++            u'bin': u'keyfinder-cli',
+             u'auto': True,
+             u'overwrite': False,
+         })
+diff --git a/test/test_keyfinder.py b/test/test_keyfinder.py
+index c8735e47..d7d670a4 100644
+--- a/test/test_keyfinder.py
++++ b/test/test_keyfinder.py
+@@ -44,7 +44,7 @@ class KeyFinderTest(unittest.TestCase, TestHelper):
+         item.load()
+         self.assertEqual(item['initial_key'], 'C#m')
+         command_output.assert_called_with(
+-            ['KeyFinder', '-f', util.syspath(item.path)])
++            ['keyfinder-cli', util.syspath(item.path)])
+
+     def test_add_key_on_import(self, command_output):
+         command_output.return_value = util.CommandOutput(b"dbm", b"")
diff --git a/nixpkgs/pkgs/tools/audio/beets/plugins/alternatives.nix b/nixpkgs/pkgs/tools/audio/beets/plugins/alternatives.nix
new file mode 100644
index 000000000000..fdad7dd89844
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/beets/plugins/alternatives.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchFromGitHub, beets, pythonPackages }:
+
+pythonPackages.buildPythonApplication rec {
+  pname = "beets-alternatives";
+  version = "0.9.0";
+
+  src = fetchFromGitHub {
+    repo = "beets-alternatives";
+    owner = "geigerzaehler";
+    # This is 0.8.2 with fixes against Beets 1.4.6 and Python 3 compatibility.
+    rev = "v${version}";
+    sha256 = "19160gwg5j6asy8mc21g2kf87mx4zs9x2gbk8q4r6330z4kpl5pm";
+  };
+
+  nativeBuildInputs = [ beets pythonPackages.nose ];
+
+  checkPhase = "nosetests";
+
+  meta = {
+    description = "Beets plugin to manage external files";
+    homepage = "https://github.com/geigerzaehler/beets-alternatives";
+    maintainers = [ stdenv.lib.maintainers.aszlig ];
+    license = stdenv.lib.licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/audio/beets/plugins/check-tests.patch b/nixpkgs/pkgs/tools/audio/beets/plugins/check-tests.patch
new file mode 100644
index 000000000000..2de97b86c8b4
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/beets/plugins/check-tests.patch
@@ -0,0 +1,17 @@
+diff --git a/test/cli_test.py b/test/cli_test.py
+index 26df140..2eb913c 100644
+--- a/test/cli_test.py
++++ b/test/cli_test.py
+@@ -372,12 +372,6 @@ class ToolListTest(TestHelper, TestCase):
+         self.assertIn('flac', stdout.getvalue())
+         self.assertIn('oggz-validate', stdout.getvalue())
+ 
+-    def test_found_mp3val(self):
+-        shutil.copy('/bin/echo', os.path.join(self.temp_dir, 'mp3val'))
+-        with captureStdout() as stdout:
+-            beets.ui._raw_main(['check', '--list-tools'])
+-        self.assertRegexpMatches(stdout.getvalue(), r'mp3val *found')
+-
+     def test_oggz_validate_not_found(self):
+         with captureStdout() as stdout:
+             beets.ui._raw_main(['check', '--list-tools'])
diff --git a/nixpkgs/pkgs/tools/audio/beets/plugins/check.nix b/nixpkgs/pkgs/tools/audio/beets/plugins/check.nix
new file mode 100644
index 000000000000..241dcdad4521
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/beets/plugins/check.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchFromGitHub, beets, pythonPackages, flac, liboggz, mp3val }:
+
+pythonPackages.buildPythonApplication rec {
+  name = "beets-check";
+  version = "0.12.0";
+
+  src = fetchFromGitHub {
+    repo = "beets-check";
+    owner = "geigerzaehler";
+    rev = "v${version}";
+    sha256 = "0b2ijjf0gycs6b40sm33ida3sjygjiv4spb5mba52vysc7iwmnjn";
+  };
+
+  nativeBuildInputs = [ beets ];
+  checkInputs = [ pythonPackages.nose flac liboggz mp3val ];
+  propagatedBuildInputs = [ flac liboggz mp3val ];
+
+  # patch out broken tests
+  patches = [ ./beet-check-tests.patch ];
+
+  # patch out futures dependency, it is only needed for Python2 which we don't
+  # support.
+  prePatch = ''
+    sed -i "/futures/d" setup.py
+  '';
+
+  checkPhase = "nosetests";
+
+  meta = with stdenv.lib; {
+    description = "Beets plugin to Verify and store checksums in your library";
+    homepage = "https://github.com/geigerzaehler/beets-check";
+    license = licenses.mit;
+    maintainers = with maintainers; [ lovesegfault ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/audio/beets/plugins/copyartifacts.nix b/nixpkgs/pkgs/tools/audio/beets/plugins/copyartifacts.nix
new file mode 100644
index 000000000000..9432cb9bd0b9
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/beets/plugins/copyartifacts.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchFromGitHub, beets, pythonPackages, glibcLocales }:
+
+pythonPackages.buildPythonApplication {
+  name = "beets-copyartifacts";
+
+  src = fetchFromGitHub {
+    repo = "beets-copyartifacts";
+    owner = "sbarakat";
+    rev = "d0bb75c8fc8fe125e8191d73de7ade6212aec0fd";
+    sha256 = "19b4lqq1p45n348ssmql60jylw2fw7vfj9j22nly5qj5qx51j3g5";
+  };
+
+  postPatch = ''
+    sed -i -e '/install_requires/,/\]/{/beets/d}' setup.py
+    sed -i -e '/namespace_packages/d' setup.py
+    printf 'from pkgutil import extend_path\n__path__ = extend_path(__path__, __name__)\n' >beetsplug/__init__.py
+
+    # Skip test which is already failing upstream.
+    sed -i -e '1i import unittest' \
+           -e 's/\(^ *\)# failing/\1@unittest.skip/' \
+           tests/test_reimport.py
+  '';
+
+  nativeBuildInputs = [ beets pythonPackages.nose glibcLocales ];
+
+  checkPhase = "LANG=en_US.UTF-8 nosetests";
+
+  meta = {
+    description = "Beets plugin to move non-music files during the import process";
+    homepage = "https://github.com/sbarakat/beets-copyartifacts";
+    license = stdenv.lib.licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/audio/beets/plugins/extrafiles.nix b/nixpkgs/pkgs/tools/audio/beets/plugins/extrafiles.nix
new file mode 100644
index 000000000000..7d0e446ce605
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/beets/plugins/extrafiles.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchFromGitHub, beets, pythonPackages }:
+
+pythonPackages.buildPythonApplication rec {
+  pname = "beets-extrafiles";
+  version = "0.0.7";
+
+  src = fetchFromGitHub {
+    repo = "beets-extrafiles";
+    owner = "Holzhaus";
+    rev = "v${version}";
+    sha256 = "0ah7mgax9zrhvvd5scf2z0v0bhd6xmmv5sdb6av840ixpl6vlvm6";
+  };
+
+  postPatch = ''
+    sed -i -e '/install_requires/,/\]/{/beets/d}' setup.py
+    sed -i -e '/namespace_packages/d' setup.py
+  '';
+
+  nativeBuildInputs = [ beets ];
+
+  preCheck = ''
+    HOME=$TEMPDIR
+  '';
+
+  meta = {
+    homepage = "https://github.com/Holzhaus/beets-extrafiles";
+    description = "A plugin for beets that copies additional files and directories during the import process";
+    license = stdenv.lib.licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/audio/beets/replaygain-default-ffmpeg.patch b/nixpkgs/pkgs/tools/audio/beets/replaygain-default-ffmpeg.patch
new file mode 100644
index 000000000000..0ceba3c09442
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/beets/replaygain-default-ffmpeg.patch
@@ -0,0 +1,26 @@
+diff --git i/beetsplug/replaygain.py w/beetsplug/replaygain.py
+index 9d6fa23c..c5800039 100644
+--- i/beetsplug/replaygain.py
++++ w/beetsplug/replaygain.py
+@@ -391,7 +391,7 @@ class FfmpegBackend(Backend):
+ 
+     def __init__(self, config, log):
+         super(FfmpegBackend, self).__init__(config, log)
+-        self._ffmpeg_path = "ffmpeg"
++        self._ffmpeg_path = "@ffmpeg@/bin/ffmpeg"
+ 
+         # check that ffmpeg is installed
+         try:
+@@ -1228,11 +1228,10 @@ class ReplayGainPlugin(BeetsPlugin):
+     def __init__(self):
+         super(ReplayGainPlugin, self).__init__()
+ 
+-        # default backend is 'command' for backward-compatibility.
+         self.config.add({
+             'overwrite': False,
+             'auto': True,
+-            'backend': u'command',
++            'backend': u'ffmpeg',
+             'threads': cpu_count(),
+             'parallel_on_import': False,
+             'per_disc': False,
diff --git a/nixpkgs/pkgs/tools/audio/bpm-tools/default.nix b/nixpkgs/pkgs/tools/audio/bpm-tools/default.nix
new file mode 100644
index 000000000000..6207cbeb9fe6
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/bpm-tools/default.nix
@@ -0,0 +1,43 @@
+{
+  stdenv,
+  fetchurl,
+  gnuplot,
+  sox,
+  flac,
+  id3v2,
+  vorbis-tools,
+  makeWrapper
+}:
+
+let
+  path = stdenv.lib.makeBinPath [ gnuplot sox flac id3v2 vorbis-tools ];
+in
+stdenv.mkDerivation rec {
+  pname = "bpm-tools";
+  version = "0.3";
+
+  src = fetchurl {
+    url = "http://www.pogo.org.uk/~mark/bpm-tools/releases/bpm-tools-${version}.tar.gz";
+    sha256 = "151vfbs8h3cibs7kbdps5pqrsxhpjv16y2iyfqbxzsclylgfivrp";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  installFlags = [
+    "PREFIX=${placeholder "out"}"
+  ];
+
+  postFixup = ''
+    wrapProgram $out/bin/bpm-tag --prefix PATH : "${path}"
+    wrapProgram $out/bin/bpm-graph --prefix PATH : "${path}"
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = "http://www.pogo.org.uk/~mark/bpm-tools/";
+    description = "Automatically calculate BPM (tempo) of music files";
+    license = licenses.gpl2;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ doronbehar ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/tools/audio/darkice/default.nix b/nixpkgs/pkgs/tools/audio/darkice/default.nix
new file mode 100644
index 000000000000..89b93b02865f
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/darkice/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, fetchurl, pkgconfig
+, libjack2, alsaLib, libpulseaudio
+, faac, lame, libogg, libopus, libvorbis, libsamplerate
+}:
+
+stdenv.mkDerivation rec {
+  pname = "darkice";
+  version = "1.3";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/darkice/${version}/darkice-${version}.tar.gz";
+    sha256 = "1rlxds7ssq7nk2in4s46xws7xy9ylxsqgcz85hxjgh17lsm0y39c";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [
+    libopus libvorbis libogg libpulseaudio alsaLib libsamplerate libjack2 lame
+  ];
+
+  NIX_CFLAGS_COMPILE = "-fpermissive";
+
+  configureFlags = [
+    "--with-faac-prefix=${faac}"
+    "--with-lame-prefix=${lame.lib}"
+  ];
+
+  patches = [ ./fix-undeclared-memmove.patch ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = "http://darkice.org/";
+    description = "Live audio streamer";
+    license = stdenv.lib.licenses.gpl3;
+    maintainers = with stdenv.lib.maintainers; [ ikervagyok fpletz ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/audio/darkice/fix-undeclared-memmove.patch b/nixpkgs/pkgs/tools/audio/darkice/fix-undeclared-memmove.patch
new file mode 100644
index 000000000000..9b8baf9701d3
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/darkice/fix-undeclared-memmove.patch
@@ -0,0 +1,13 @@
+diff --git a/src/FaacEncoder.cpp b/src/FaacEncoder.cpp
+index 1100226..3ab1805 100644
+--- a/src/FaacEncoder.cpp
++++ b/src/FaacEncoder.cpp
+@@ -36,7 +36,7 @@
+ // compile the whole file only if faac support configured in
+ #ifdef HAVE_FAAC_LIB
+ 
+-
++#include <string.h>
+ 
+ #include "Exception.h"
+ #include "Util.h"
diff --git a/nixpkgs/pkgs/tools/audio/dir2opus/default.nix b/nixpkgs/pkgs/tools/audio/dir2opus/default.nix
new file mode 100644
index 000000000000..872006547031
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/dir2opus/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchurl, python, mutagen, wrapPython, opusTools, mpg123 }:
+
+let version = "0.12.2"; in
+stdenv.mkDerivation rec {
+  pname = "dir2opus";
+  inherit version;
+
+  pythonPath = [ mutagen ];
+  buildInputs = [ wrapPython ];
+  propagatedBuildInputs = [ opusTools mpg123 ];
+
+  src = fetchurl {
+    url = "https://github.com/ehmry/dir2opus/archive/${version}.tar.gz";
+    name = "${pname}-${version}.tar.gz";
+    sha256 = "0bl8fa9zhccihnj1v3lpz5jb737frf9za06xb7j5rsjws6xky80d";
+  };
+
+  postPatch = "sed -i -e 's|#!/usr/bin/python|#!${python}/bin/python|' dir2opus";
+
+  installPhase =
+    ''
+      mkdir -p $out/bin $out/share/man/man1
+      cp dir2opus $out/bin
+      cp dir2opus.1 $out/share/man/man1
+    '';
+
+  postFixup = "wrapPythonPrograms";
+
+  meta = with stdenv.lib; {
+    homepage = "https://github.com/ehmry/dir2opus";
+    maintainers = [ maintainers.ehmry ];
+    license = licenses.gpl2;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/audio/essentia-extractor/default.nix b/nixpkgs/pkgs/tools/audio/essentia-extractor/default.nix
new file mode 100644
index 000000000000..0d2bb17a75d4
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/essentia-extractor/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, fetchurl }:
+let
+  arch_table = {
+    "x86_64-linux" = "linux-x86_64";
+    "i686-linux" = "linux-i686";
+  };
+
+  sha_table = {
+    "x86_64-linux" =
+      "d9902aadac4f442992877945da2a6fe8d6ea6b0de314ca8ac0c28dc5f253f7d8";
+    "i686-linux" =
+      "46deb0a053b4910c4e68737a7b6556ff5360260c8f86652f91a0130445f5c949";
+  };
+
+  arch = arch_table.${stdenv.system};
+  sha = sha_table.${stdenv.system};
+in stdenv.mkDerivation rec {
+  pname = "essentia-extractor";
+  version = "2.1_beta2";
+
+  src = fetchurl {
+    url =
+      "ftp://ftp.acousticbrainz.org/pub/acousticbrainz/essentia-extractor-v${version}-${arch}.tar.gz";
+    sha256 = sha;
+  };
+
+  unpackPhase = "unpackFile $src ; export sourceRoot=.";
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp streaming_extractor_music $out/bin
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = "https://acousticbrainz.org/download";
+    description = "AcousticBrainz audio feature extractor";
+    license = licenses.agpl3Plus;
+    maintainers = with maintainers; [ lovesegfault ];
+    platforms = [ "x86_64-linux" "i686-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/audio/ezstream/default.nix b/nixpkgs/pkgs/tools/audio/ezstream/default.nix
new file mode 100644
index 000000000000..499f9842852f
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/ezstream/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchurl, libiconv, libshout, taglib, libxml2, pkgconfig }:
+
+stdenv.mkDerivation rec {
+  pname = "ezstream";
+  version = "0.6.0";
+
+  src = fetchurl {
+    url = "https://ftp.osuosl.org/pub/xiph/releases/ezstream/${pname}-${version}.tar.gz";
+    sha256 = "f86eb8163b470c3acbc182b42406f08313f85187bd9017afb8b79b02f03635c9";
+  };
+
+  buildInputs = [ libiconv libshout taglib libxml2 ];
+  nativeBuildInputs = [ pkgconfig ];
+
+  doCheck = true;
+
+  meta = with stdenv.lib; {
+    description = "A command line source client for Icecast media streaming servers";
+    longDescription = ''
+      Ezstream is a command line source client for Icecast media
+      streaming servers. It began as the successor of the old "shout"
+      utility, and has since gained a lot of useful features.
+
+      In its basic mode of operation, it streams media files or data
+      from standard input without reencoding and thus requires only
+      very little CPU resources.
+    '';
+    homepage = "https://icecast.org/ezstream/";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.barrucadu ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/audio/glyr/default.nix b/nixpkgs/pkgs/tools/audio/glyr/default.nix
new file mode 100644
index 000000000000..41490381487e
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/glyr/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchFromGitHub, cmake
+, curl, glib, sqlite, pkgconfig }:
+
+stdenv.mkDerivation rec {
+  version = "1.0.10";
+  pname = "glyr";
+
+  src = fetchFromGitHub {
+    owner = "sahib";
+    repo = "glyr";
+    rev = version;
+    sha256 = "1miwbqzkhg0v3zysrwh60pj9sv6ci4lzq2vq2hhc6pc6hdyh8xyr";
+  };
+
+  nativeBuildInputs = [ cmake pkgconfig ];
+  buildInputs = [ sqlite glib curl ];
+
+  meta = with stdenv.lib; {
+    license = licenses.lgpl3;
+    description = "A music related metadata searchengine";
+    homepage = "https://github.com/sahib/glyr";
+    maintainers = [ maintainers.sternenseemann ];
+    platforms = platforms.unix;
+  };
+}
+
+
diff --git a/nixpkgs/pkgs/tools/audio/google-music-scripts/default.nix b/nixpkgs/pkgs/tools/audio/google-music-scripts/default.nix
new file mode 100644
index 000000000000..272cf9025392
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/google-music-scripts/default.nix
@@ -0,0 +1,59 @@
+{ lib, python3 }:
+
+let
+  py = python3.override {
+    packageOverrides = self: super: {
+      loguru = super.loguru.overridePythonAttrs (oldAttrs: rec {
+        version = "0.4.0";
+        src = oldAttrs.src.override {
+          inherit version;
+          sha256 = "0j47cg3gi8in4z6z4w3by6x02mpkkfl78gr85xjn5rg0nxiz7pfm";
+        };
+      });
+    };
+  };
+
+in
+
+with py.pkgs;
+
+buildPythonApplication rec {
+  pname = "google-music-scripts";
+  version = "4.5.0";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "0apwgj86whrc077dfymvyb4qwj19bawyrx49g4kg364895v0rbbq";
+  };
+
+  # pendulum pinning was to prevent PEP517 from trying to build from source
+  postPatch = ''
+    substituteInPlace setup.py \
+      --replace "tomlkit>=0.5,<0.6" "tomlkit" \
+      --replace "pendulum>=2.0,<=3.0,!=2.0.5,!=2.1.0" "pendulum"
+  '';
+
+  propagatedBuildInputs = [
+    appdirs
+    audio-metadata
+    google-music
+    google-music-proto
+    google-music-utils
+    loguru
+    pendulum
+    natsort
+    tomlkit
+  ];
+
+  # No tests
+  checkPhase = ''
+    $out/bin/gms --help >/dev/null
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/thebigmunch/google-music-scripts";
+    description = "A CLI utility for interacting with Google Music";
+    license = licenses.mit;
+    maintainers = with maintainers; [ jakewaksbaum ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/audio/gvolicon/default.nix b/nixpkgs/pkgs/tools/audio/gvolicon/default.nix
new file mode 100644
index 000000000000..5190699be087
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/gvolicon/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, makeWrapper, alsaLib, pkgconfig, fetchgit, gtk3, gnome3, gdk-pixbuf, librsvg, wrapGAppsHook }:
+
+stdenv.mkDerivation {
+  name = "gvolicon-2014-04-28";
+  src = fetchgit {
+    url = "https://github.com/Unia/gvolicon";
+    rev = "0d65a396ba11f519d5785c37fec3e9a816217a07";
+    sha256 = "1sr9wyy7w898vq63yd003yp3k66hd4vm8b0qsm9zvmwmpiz4wvln";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [
+    makeWrapper alsaLib gtk3 gdk-pixbuf gnome3.adwaita-icon-theme
+    librsvg wrapGAppsHook
+  ];
+
+  makeFlags = [ "PREFIX=$(out)" ];
+
+  NIX_CFLAGS_COMPILE = "-D_POSIX_C_SOURCE";
+
+  meta = {
+    description = "A simple and lightweight volume icon that sits in your system tray";
+    homepage = "https://github.com/Unia/gvolicon";
+    platforms = stdenv.lib.platforms.linux;
+    license = stdenv.lib.licenses.gpl3Plus;
+    maintainers = [ stdenv.lib.maintainers.bennofs ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/audio/kaldi/default.nix b/nixpkgs/pkgs/tools/audio/kaldi/default.nix
new file mode 100644
index 000000000000..fa291a05078e
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/kaldi/default.nix
@@ -0,0 +1,88 @@
+{ stdenv
+, openblas
+, blas
+, lapack
+, openfst
+, icu
+, cmake
+, pkg-config
+, fetchFromGitHub
+, git
+, python3
+}:
+
+assert blas.implementation == "openblas" && lapack.implementation == "openblas";
+let
+  # rev from https://github.com/kaldi-asr/kaldi/blob/master/cmake/third_party/openfst.cmake
+  openfst = fetchFromGitHub {
+    owner = "kkm000";
+    repo = "openfst";
+    rev = "0bca6e76d24647427356dc242b0adbf3b5f1a8d9";
+    sha256 = "1802rr14a03zl1wa5a0x1fa412kcvbgprgkadfj5s6s3agnn11rx";
+  };
+in
+stdenv.mkDerivation {
+  pname = "kaldi";
+  version = "2020-12-26";
+
+  src = fetchFromGitHub {
+    owner = "kaldi-asr";
+    repo = "kaldi";
+    rev = "813b73185a18725e4f6021981d17221d6ee23a19";
+    sha256 = "sha256-lTqXTG5ZTPmhCgt+BVzOwjKEIj+bLGUa+IxJq+XtHUg=";
+  };
+
+  cmakeFlags = [
+    "-DKALDI_BUILD_TEST=off"
+    "-DBUILD_SHARED_LIBS=on"
+  ];
+
+  preConfigure = ''
+    mkdir bin
+    cat > bin/git <<'EOF'
+    #!${stdenv.shell}
+    if [[ "$1" == "--version" ]]; then
+      # cmake checks this
+      ${git}/bin/git --version
+    elif [[ "$1" == "clone" ]]; then
+      # mock this call:
+
+      # https://github.com/kaldi-asr/kaldi/blob/c9d8b9ad3fef89237ba5517617d977b7d70a7ed5/cmake/third_party/openfst.cmake#L5
+      cp -r ${openfst} ''${@: -1}
+      chmod -R +w ''${@: -1}
+    elif [[ "$1" == "rev-list" ]]; then
+      # fix up this call:
+      # https://github.com/kaldi-asr/kaldi/blob/c9d8b9ad3fef89237ba5517617d977b7d70a7ed5/cmake/VersionHelper.cmake#L8
+      echo 0
+    fi
+    true
+    EOF
+    chmod +x bin/git
+    export PATH=$(pwd)/bin:$PATH
+  '';
+
+  buildInputs = [
+    openblas
+    openfst
+    icu
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+    python3
+  ];
+
+  postInstall = ''
+    mkdir -p $out/share/kaldi
+    cp -r ../egs $out/share/kaldi
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Speech Recognition Toolkit";
+    homepage = "https://kaldi-asr.org";
+    license = licenses.mit;
+    maintainers = with maintainers; [ mic92 ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/audio/liquidsoap/full.nix b/nixpkgs/pkgs/tools/audio/liquidsoap/full.nix
new file mode 100644
index 000000000000..a228c23651db
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/liquidsoap/full.nix
@@ -0,0 +1,74 @@
+{ stdenv, makeWrapper, fetchurl, which, pkgconfig
+, ocamlPackages
+, libao, portaudio, alsaLib, libpulseaudio, libjack2
+, libsamplerate, libmad, taglib, lame, libogg
+, libvorbis, speex, libtheora, libopus
+, faad2, flac, ladspaH, ffmpeg, frei0r, dssi
+}:
+
+let
+  pname = "liquidsoap";
+  version = "1.4.2";
+
+  ocaml-ffmpeg = fetchurl {
+    url = "https://github.com/savonet/ocaml-ffmpeg/releases/download/v0.4.2/ocaml-ffmpeg-0.4.2.tar.gz";
+    sha256 = "1lx5s1avds9fsh77828ifn71r2g89rxakhs8pp995a675phm9viw";
+  };
+
+  packageFilters = map (p: "-e '/ocaml-${p}/d'" )
+    [ "gstreamer" "shine" "aacplus" "schroedinger"
+      "voaacenc" "soundtouch" "gavl" "lo"
+    ];
+in
+stdenv.mkDerivation {
+  name = "${pname}-full-${version}";
+
+  src = fetchurl {
+    url = "https://github.com/savonet/${pname}/releases/download/v${version}/${pname}-${version}-full.tar.gz";
+    sha256 = "0wkwnzj1a0vizv7sr1blwk5gzm2qi0n02ndijnq1i50cwrgxs1a4";
+  };
+
+  # Use ocaml-srt and ocaml-fdkaac from nixpkgs
+  # Use ocaml-ffmpeg at 0.4.2 for compatibility with ffmpeg 4.3
+  prePatch = ''
+    rm -rf ocaml-srt*/ ocaml-fdkaac*/ ocaml-ffmpeg*/
+    tar xzf ${ocaml-ffmpeg}
+  '';
+
+  preConfigure = /* we prefer system-wide libs */ ''
+    sed -i "s|gsed|sed|" Makefile
+    make bootstrap
+    # autoreconf -vi # use system libraries
+
+    sed ${toString packageFilters} PACKAGES.default > PACKAGES
+  '';
+
+  postFixup = ''
+    wrapProgram $out/bin/liquidsoap --set LIQ_LADSPA_PATH /run/current-system/sw/lib/ladspa
+  '';
+
+  configureFlags = [ "--localstatedir=/var" ];
+
+  nativeBuildInputs = [ makeWrapper pkgconfig ];
+  buildInputs =
+    [ which ocamlPackages.ocaml ocamlPackages.findlib
+      libao portaudio alsaLib libpulseaudio libjack2
+      libsamplerate libmad taglib lame libogg
+      libvorbis speex libtheora libopus
+      faad2 flac ladspaH ffmpeg frei0r dssi
+      ocamlPackages.xmlm ocamlPackages.ocaml_pcre
+      ocamlPackages.camomile
+      ocamlPackages.fdkaac
+      ocamlPackages.srt ocamlPackages.sedlex_2 ocamlPackages.menhir
+    ];
+
+  hardeningDisable = [ "format" "fortify" ];
+
+  meta = with stdenv.lib; {
+    description = "Swiss-army knife for multimedia streaming";
+    homepage = "https://www.liquidsoap.info/";
+    maintainers = with maintainers; [ ehmry ];
+    license = licenses.gpl2;
+    platforms = ocamlPackages.ocaml.meta.platforms or [];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/audio/midicsv/default.nix b/nixpkgs/pkgs/tools/audio/midicsv/default.nix
new file mode 100644
index 000000000000..e5f3f6124b9b
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/midicsv/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "midicsv-1.1";
+
+  src = fetchurl {
+    url = "http://www.fourmilab.ch/webtools/midicsv/${name}.tar.gz";
+    sha256 = "1vvhk2nf9ilfw0wchmxy8l13hbw9cnpz079nsx5srsy4nnd78nkw";
+  };
+
+  postPatch = ''
+    substituteInPlace Makefile --replace /usr/local $out
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Losslessly translate MIDI to CSV and back";
+    homepage = "http://www.fourmilab.ch/webtools/midicsv/";
+    license = licenses.publicDomain;
+    maintainers = with maintainers; [ orivej ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/audio/mididings/default.nix b/nixpkgs/pkgs/tools/audio/mididings/default.nix
new file mode 100644
index 000000000000..addb95b9f1bd
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/mididings/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, pythonPackages, fetchFromGitHub, pkg-config, glib, alsaLib, libjack2  }:
+
+pythonPackages.buildPythonApplication {
+  version = "2015-11-17";
+  pname = "mididings";
+
+  src = fetchFromGitHub {
+    owner = "dsacre";
+    repo = "mididings";
+    rev = "bbec99a8c878a2a7029e78e84fc736e4a68ed5a0";
+    sha256 = "1pdf5mib87zy7yjh9vpasja419h28wvgq6x5hw2hkm7bg9ds4p2m";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ glib alsaLib libjack2 pythonPackages.boost ];
+  propagatedBuildInputs = with pythonPackages; [ decorator ]
+    # for livedings
+    ++ [ tkinter pyliblo ]
+    # for mididings.extra
+    ++ [ dbus-python pyinotify ]
+    # to read/write standard MIDI files
+    ++ [ pysmf ]
+    # so mididings knows where to look for config files
+    ++ [ pyxdg ];
+
+  preBuild = with stdenv.lib.versions; ''
+    substituteInPlace setup.py \
+      --replace boost_python "boost_python${major pythonPackages.python.version}${minor pythonPackages.python.version}"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A MIDI router and processor based on Python, supporting ALSA and JACK MIDI";
+    homepage = "http://das.nasophon.de/mididings";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.gnidorah ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/audio/mp3cat/default.nix b/nixpkgs/pkgs/tools/audio/mp3cat/default.nix
new file mode 100644
index 000000000000..e7a1d004a019
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/mp3cat/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "mp3cat";
+  version = "0.5";
+
+  src = fetchFromGitHub {
+    owner = "tomclegg";
+    repo = pname;
+    rev = version;
+    sha256 = "0n6hjg2wgd06m561zc3ib5w2m3pwpf74njv2b2w4sqqh5md2ymfr";
+  };
+
+  makeFlags = [
+    "PREFIX=${placeholder "out"}"
+  ];
+
+  installTargets = [
+    "install_bin"
+  ];
+
+  meta = with stdenv.lib; {
+    description = "A command line program which concatenates MP3 files";
+    longDescription = ''
+      A command line program which concatenates MP3 files, mp3cat
+      only outputs MP3 frames with valid headers, even if there is extra garbage
+      in its input stream
+    '';
+    homepage = "https://github.com/tomclegg/mp3cat";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.omnipotententity ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/audio/mpd-mpris/default.nix b/nixpkgs/pkgs/tools/audio/mpd-mpris/default.nix
new file mode 100644
index 000000000000..c66a12dadd3a
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/mpd-mpris/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, buildGoModule, fetchFromGitHub }:
+
+buildGoModule rec {
+  pname = "mpd-mpris";
+  version = "0.3.0";
+
+  src = fetchFromGitHub {
+    owner = "natsukagami";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1kzjbv04b2garb99l64wdq8yksnm4pbhkgyzh89j5j3gb9k55zal";
+  };
+
+  vendorSha256 = "1ggrqwd3h602rav1dc3amsf4wxsq8mdq4ijkdsg759sqhpzl6rqs";
+
+  doCheck = false;
+
+  subPackages = [ "cmd/${pname}" ];
+
+  postInstall = ''
+    substituteInPlace mpd-mpris.service \
+      --replace /usr/bin $out/bin
+    mkdir -p $out/lib/systemd/user
+    cp mpd-mpris.service $out/lib/systemd/user
+  '';
+
+  meta = with stdenv.lib; {
+    description = "An implementation of the MPRIS protocol for MPD";
+    homepage = "https://github.com/natsukagami/mpd-mpris";
+    license = licenses.mit;
+    maintainers = with maintainers; [ doronbehar ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/audio/mpdas/default.nix b/nixpkgs/pkgs/tools/audio/mpdas/default.nix
new file mode 100644
index 000000000000..507e62b0dae9
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/mpdas/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchFromGitHub, pkgconfig, mpd_clientlib, curl }:
+
+stdenv.mkDerivation rec {
+  pname = "mpdas";
+  version = "0.4.5";
+
+  src = fetchFromGitHub {
+    owner = "hrkfdn";
+    repo = "mpdas";
+    rev = version;
+    sha256 = "0fcqc4w6iwbi1n3cllcgj0k61zffhqkbr8668myxap21m35x8y1r";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+
+  buildInputs = [ mpd_clientlib curl ];
+
+  makeFlags = [ "CONFIG=/etc" "DESTDIR=" "PREFIX=$(out)" ];
+
+  meta = with stdenv.lib; {
+    description = "Music Player Daemon AudioScrobbler";
+    homepage = "https://50hz.ws/mpdas/";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.taketwo ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/audio/mpdcron/Gemfile b/nixpkgs/pkgs/tools/audio/mpdcron/Gemfile
new file mode 100644
index 000000000000..e0814bc4ddab
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/mpdcron/Gemfile
@@ -0,0 +1,2 @@
+source "https://rubygems.org"
+gem "nokogiri"
diff --git a/nixpkgs/pkgs/tools/audio/mpdcron/Gemfile.lock b/nixpkgs/pkgs/tools/audio/mpdcron/Gemfile.lock
new file mode 100644
index 000000000000..603a9cfdafb1
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/mpdcron/Gemfile.lock
@@ -0,0 +1,15 @@
+GEM
+  remote: https://rubygems.org/
+  specs:
+    mini_portile2 (2.4.0)
+    nokogiri (1.10.3)
+      mini_portile2 (~> 2.4.0)
+
+PLATFORMS
+  ruby
+
+DEPENDENCIES
+  nokogiri
+
+BUNDLED WITH
+   2.1.4
diff --git a/nixpkgs/pkgs/tools/audio/mpdcron/default.nix b/nixpkgs/pkgs/tools/audio/mpdcron/default.nix
new file mode 100644
index 000000000000..c083c60a9625
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/mpdcron/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, fetchFromGitHub, autoconf, automake, libtool, pkgconfig, glib, libdaemon
+, mpd_clientlib, curl, sqlite, bundlerEnv, libnotify, pandoc }:
+
+let
+  gemEnv = bundlerEnv {
+    name = "mpdcron-bundle";
+    gemdir = ./.;
+  };
+in stdenv.mkDerivation {
+  version = "20161228";
+  pname = "mpdcron";
+
+  src = fetchFromGitHub {
+    owner = "alip";
+    repo = "mpdcron";
+    rev = "e49e6049b8693d31887c538ddc7b19f5e8ca476b";
+    sha256 = "0vdksf6lcgmizqr5mqp0bbci259k0dj7gpmhx32md41jlmw5skaw";
+  };
+
+  meta = with stdenv.lib; {
+    description = "A cron like daemon for mpd";
+    homepage    = "http://alip.github.io/mpdcron/";
+    license     = licenses.gpl2;
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ lovek323 manveru ];
+  };
+
+  buildInputs =
+    [ autoconf automake libtool pkgconfig glib libdaemon pandoc
+      mpd_clientlib curl sqlite gemEnv.wrappedRuby libnotify ];
+
+  preConfigure = ''
+    ./autogen.sh
+  '';
+
+  configureFlags = [ "--enable-gmodule" "--with-standard-modules=all" ];
+}
diff --git a/nixpkgs/pkgs/tools/audio/mpdcron/gemset.nix b/nixpkgs/pkgs/tools/audio/mpdcron/gemset.nix
new file mode 100644
index 000000000000..025eb96b0652
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/mpdcron/gemset.nix
@@ -0,0 +1,23 @@
+{
+  mini_portile2 = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "15zplpfw3knqifj9bpf604rb3wc1vhq6363pd6lvhayng8wql5vy";
+      type = "gem";
+    };
+    version = "2.4.0";
+  };
+  nokogiri = {
+    dependencies = ["mini_portile2"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "02bjydih0j515szfv9mls195cvpyidh6ixm7dwbl3s2sbaxxk5s4";
+      type = "gem";
+    };
+    version = "1.10.3";
+  };
+}
\ No newline at end of file
diff --git a/nixpkgs/pkgs/tools/audio/mpdris2/default.nix b/nixpkgs/pkgs/tools/audio/mpdris2/default.nix
new file mode 100644
index 000000000000..029dcd127f13
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/mpdris2/default.nix
@@ -0,0 +1,55 @@
+{ stdenv
+, autoreconfHook
+, fetchFromGitHub
+, glib
+, gobject-introspection
+, intltool
+, libnotify
+, python3
+, wrapGAppsHook
+}:
+
+python3.pkgs.buildPythonApplication rec {
+  pname = "mpDris2";
+  version = "0.8";
+  format = "other";
+  strictDeps = false; # https://github.com/NixOS/nixpkgs/issues/56943
+
+  src = fetchFromGitHub {
+    owner = "eonpatapon";
+    repo = pname;
+    rev = version;
+    sha256 = "048b8acsd1b8kcxzd9fsh5p9g2an9c4rznicfcpyrsjz5syv894h";
+  };
+
+  preConfigure = ''
+    intltoolize -f
+  '';
+
+  nativeBuildInputs = [
+    autoreconfHook
+    gobject-introspection
+    intltool
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    glib
+    libnotify
+  ];
+
+  propagatedBuildInputs = with python3.pkgs; [
+    dbus-python
+    mpd2
+    mutagen
+    pygobject3
+  ];
+
+  meta = with stdenv.lib; {
+    description = "MPRIS 2 support for mpd";
+    homepage = "https://github.com/eonpatapon/mpDris2/";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/audio/mpdsync/default.nix b/nixpkgs/pkgs/tools/audio/mpdsync/default.nix
new file mode 100644
index 000000000000..51f5ba656168
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/mpdsync/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, python2, fetchFromGitHub }:
+with python2.pkgs;
+stdenv.mkDerivation {
+  name = "mpdsync-2017-06-15";
+
+  src = fetchFromGitHub {
+    owner = "alphapapa";
+    repo = "mpdsync";
+    rev = "da90058f44dd9578cc5f2fb96a1fb2b26da40d07";
+    sha256 = "1mfg3ipqj5dvyyqbgp6ia6sc1ja5gmm2c9mfrwx0jw2dl182if6q";
+  };
+
+  pythonPath = [ mpd2 ];
+
+  nativeBuildInputs = [
+    wrapPython
+  ];
+
+  dontBuild = true;
+
+  installPhase = "install -D mpdsync.py $out/bin/mpdsync";
+  postFixup = "wrapPythonPrograms";
+
+}
diff --git a/nixpkgs/pkgs/tools/audio/opl3bankeditor/default.nix b/nixpkgs/pkgs/tools/audio/opl3bankeditor/default.nix
new file mode 100644
index 000000000000..381591edb021
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/opl3bankeditor/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, mkDerivation, fetchFromGitHub, cmake, qttools, alsaLib }:
+
+mkDerivation rec {
+  version = "1.5.1";
+  pname = "OPL3BankEditor";
+
+  src = fetchFromGitHub {
+    owner = "Wohlstand";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1g59qrkcm4xnyxx0s2x28brqbf2ix6vriyx12pcdvfhhcdi55hxh";
+    fetchSubmodules = true;
+  };
+
+  buildInputs = [
+    alsaLib qttools
+  ];
+  nativeBuildInputs = [ cmake ];
+
+  meta = with stdenv.lib; {
+    description = "A small cross-platform editor of the OPL3 FM banks of different formats";
+    homepage = src.meta.homepage;
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ gnidorah ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/audio/opl3bankeditor/opn2bankeditor.nix b/nixpkgs/pkgs/tools/audio/opl3bankeditor/opn2bankeditor.nix
new file mode 100644
index 000000000000..1d10452470ed
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/opl3bankeditor/opn2bankeditor.nix
@@ -0,0 +1,14 @@
+{ opl3bankeditor, fetchFromGitHub }:
+
+opl3bankeditor.overrideAttrs (oldAttrs: rec {
+  version = "1.3";
+  pname = "OPN2BankEditor";
+
+  src = fetchFromGitHub {
+    owner = "Wohlstand";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0xsvv0gxqh1lx22f1jm384f7mq1jp57fmpsx1jjaxz435w5hf8s0";
+    fetchSubmodules = true;
+  };
+})
diff --git a/nixpkgs/pkgs/tools/audio/pa-applet/default.nix b/nixpkgs/pkgs/tools/audio/pa-applet/default.nix
new file mode 100644
index 000000000000..69e5976e6d5e
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/pa-applet/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchgit, libpulseaudio, pkgconfig, gtk3, glibc, autoconf, automake, libnotify, libX11, xf86inputevdev }:
+
+stdenv.mkDerivation {
+  name = "pa-applet-2012-04-11";
+
+  src = fetchgit {
+    url = "git://github.com/fernandotcl/pa-applet.git";
+    rev = "005f192df9ba6d2e6491f9aac650be42906b135a";
+    sha256 = "1242sdri67wnm1cd0hr40mxarkh7qs7mb9n2m0g9dbz0f4axj6wa";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [
+    gtk3 libpulseaudio glibc automake autoconf libnotify libX11 xf86inputevdev
+  ];
+
+  preConfigure = ''
+    ./autogen.sh
+  '';
+
+  # work around a problem related to gtk3 updates
+  NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";
+
+  postInstall = ''
+  '';
+
+  meta = with stdenv.lib; {
+    description = "";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ domenkozar ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/audio/pasystray/default.nix b/nixpkgs/pkgs/tools/audio/pasystray/default.nix
new file mode 100644
index 000000000000..d80f1af4182a
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/pasystray/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, fetchpatch, fetchFromGitHub, pkgconfig, autoreconfHook, wrapGAppsHook
+, gnome3, avahi, gtk3, libayatana-appindicator-gtk3, libnotify, libpulseaudio
+, xlibsWrapper, gsettings-desktop-schemas
+}:
+
+stdenv.mkDerivation rec {
+  pname = "pasystray";
+  version = "0.7.1";
+
+  src = fetchFromGitHub {
+    owner = "christophgysin";
+    repo = "pasystray";
+    rev = "${pname}-${version}";
+    sha256 = "0xx1bm9kimgq11a359ikabdndqg5q54pn1d1dyyjnrj0s41168fk";
+  };
+
+  patches = [
+    # https://github.com/christophgysin/pasystray/issues/90#issuecomment-306190701
+    ./fix-wayland.patch
+
+    # https://github.com/christophgysin/pasystray/issues/98
+    (fetchpatch {
+      url = "https://sources.debian.org/data/main/p/pasystray/0.7.1-1/debian/patches/0001-Build-against-ayatana-appindicator.patch";
+      sha256 = "0hijphrf52n2zfwdnrmxlp3a7iwznnkb79awvpzplz0ia2lqywpw";
+    })
+  ];
+
+  nativeBuildInputs = [ pkgconfig autoreconfHook wrapGAppsHook ];
+  buildInputs = [
+    gnome3.adwaita-icon-theme
+    avahi gtk3 libayatana-appindicator-gtk3 libnotify libpulseaudio xlibsWrapper
+    gsettings-desktop-schemas
+  ];
+
+  meta = with stdenv.lib; {
+    description = "PulseAudio system tray";
+    homepage = "https://github.com/christophgysin/pasystray";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ exlevan kamilchm ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/audio/pasystray/fix-wayland.patch b/nixpkgs/pkgs/tools/audio/pasystray/fix-wayland.patch
new file mode 100644
index 000000000000..17c4e2e6d658
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/pasystray/fix-wayland.patch
@@ -0,0 +1,34 @@
+--- a/src/x11-property.c
++++ b/src/x11-property.c
+@@ -43,11 +43,15 @@ static Window window;
+ void x11_property_init()
+ {
+     display = gdk_x11_get_default_xdisplay();
++    if (!GDK_IS_X11_DISPLAY(display)) return;
++    Screen* scr = ScreenOfDisplay(display, 0);
++
+     window = RootWindow(display, 0);
+ }
+ 
+ void x11_property_set(const char* key, const char* value)
+ {
++    if (!GDK_IS_X11_DISPLAY(display)) return;
+     g_debug("[x11-property] setting '%s' to '%s'", key, value);
+ 
+     Atom atom = XInternAtom(display, key, False);
+@@ -57,6 +61,7 @@ void x11_property_set(const char* key, c
+ 
+ void x11_property_del(const char* key)
+ {
++    if (!GDK_IS_X11_DISPLAY(display)) return;
+     g_debug("[x11-property] deleting '%s'", key);
+ 
+     Atom atom = XInternAtom(display, key, False);
+@@ -65,6 +70,7 @@ void x11_property_del(const char* key)
+ 
+ char* x11_property_get(const char* key)
+ {
++    if (!GDK_IS_X11_DISPLAY(display)) return NULL;
+     Atom property = XInternAtom(display, key, False);
+     Atom actual_type;
+     int actual_format;
diff --git a/nixpkgs/pkgs/tools/audio/picotts/default.nix b/nixpkgs/pkgs/tools/audio/picotts/default.nix
new file mode 100644
index 000000000000..5b7ab80d8602
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/picotts/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchFromGitHub, autoconf, automake, libtool, popt }:
+
+stdenv.mkDerivation {
+  name = "picotts-unstable-2018-10-19";
+  src = fetchFromGitHub {
+    repo = "picotts";
+    owner = "naggety";
+    rev = "2f86050dc5da9ab68fc61510b594d8e6975c4d2d";
+    sha256 = "1k2mdv9llkh77jr4qr68yf0zgjqk87np35fgfmnc3rpdp538sccl";
+  };
+  nativeBuildInputs = [ autoconf automake ];
+  buildInputs = [ libtool popt ];
+  sourceRoot = "source/pico";
+  preConfigure = "./autogen.sh";
+  meta = {
+    description = "Text to speech voice sinthesizer from SVox";
+    homepage = "https://github.com/naggety/picotts";
+    license = stdenv.lib.licenses.asl20;
+    maintainers = [ stdenv.lib.maintainers.canndrew ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
+
+
diff --git a/nixpkgs/pkgs/tools/audio/playerctl/default.nix b/nixpkgs/pkgs/tools/audio/playerctl/default.nix
new file mode 100644
index 000000000000..7ef9557b42aa
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/playerctl/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, meson, ninja, fetchFromGitHub, glib, pkgconfig, gtk-doc, docbook_xsl, gobject-introspection }:
+
+stdenv.mkDerivation rec {
+  pname = "playerctl";
+  version = "2.3.1";
+
+  src = fetchFromGitHub {
+    owner = "acrisci";
+    repo = "playerctl";
+    rev = "v${version}";
+    sha256 = "00z5c6amlxd3q42l7x8i0ngl627dxglgg5vikbbhjp9ms34xbxdn";
+  };
+
+  nativeBuildInputs = [ meson ninja pkgconfig gtk-doc docbook_xsl gobject-introspection ];
+  buildInputs = [ glib ];
+
+  mesonFlags = [ "-Dbash-completions=true" ];
+
+  meta = with stdenv.lib; {
+    description = "Command-line utility and library for controlling media players that implement MPRIS";
+    homepage = "https://github.com/acrisci/playerctl";
+    license = licenses.lgpl3;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ puffnfresh ];
+    broken = stdenv.hostPlatform.isDarwin;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/audio/pnmixer/default.nix b/nixpkgs/pkgs/tools/audio/pnmixer/default.nix
new file mode 100644
index 000000000000..c1e40ae5dbb9
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/pnmixer/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchFromGitHub, cmake, pkgconfig, gettext, alsaLib, gtk3, glib, libnotify, libX11, pcre }:
+
+stdenv.mkDerivation rec {
+  pname = "pnmixer";
+  version = "0.7.2";
+
+  src = fetchFromGitHub {
+    owner = "nicklan";
+    repo = "pnmixer";
+    rev = "v${version}";
+    sha256 = "0416pa933ddf4b7ph9zxhk5jppkk7ppcq1aqph6xsrfnka4yb148";
+  };
+
+  nativeBuildInputs = [ cmake pkgconfig gettext ];
+
+  buildInputs = [ alsaLib gtk3 glib libnotify libX11 pcre ];
+
+  meta = with stdenv.lib; {
+    homepage = "https://github.com/nicklan/pnmixer";
+    description = "ALSA volume mixer for the system tray";
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ campadrenalin romildo ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/audio/pulsemixer/default.nix b/nixpkgs/pkgs/tools/audio/pulsemixer/default.nix
new file mode 100644
index 000000000000..b735c40031f6
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/pulsemixer/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchFromGitHub, python3, libpulseaudio }:
+
+stdenv.mkDerivation rec {
+  pname = "pulsemixer";
+  version = "1.5.1";
+
+  src = fetchFromGitHub {
+    owner = "GeorgeFilipkin";
+    repo = pname;
+    rev = version;
+    sha256 = "1jagx9zmz5pfsld8y2rj2kqg6ww9f6vqiawfy3vhqc49x3xx92p4";
+  };
+
+  inherit libpulseaudio;
+
+  buildInputs = [ python3 ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    install pulsemixer $out/bin/
+  '';
+
+  postFixup = ''
+    substituteInPlace "$out/bin/pulsemixer" \
+      --replace "libpulse.so.0" "$libpulseaudio/lib/libpulse.so.0"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Cli and curses mixer for pulseaudio";
+    homepage = "https://github.com/GeorgeFilipkin/pulsemixer";
+    license = licenses.mit;
+    maintainers = [ maintainers.woffs ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/audio/qastools/default.nix b/nixpkgs/pkgs/tools/audio/qastools/default.nix
new file mode 100644
index 000000000000..55dbba007f87
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/qastools/default.nix
@@ -0,0 +1,24 @@
+{ mkDerivation, lib, fetchFromGitLab, cmake, alsaLib, udev, qtbase, qtsvg, qttools }:
+
+mkDerivation rec {
+  pname = "qastools";
+  version = "0.23.0";
+
+  src = fetchFromGitLab {
+    owner = "sebholt";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "19hn64hnvryfmrkdg6rqyzahdbqf1s5y3dcca389jj6sdx93b3ip";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ alsaLib udev qtbase qtsvg qttools ];
+
+  meta = with lib; {
+    description = "Collection of desktop applications for ALSA configuration";
+    homepage = "https://gitlab.com/sebholt/qastools";
+    license = licenses.mit;
+    maintainers = with maintainers; [ orivej ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/audio/trx/add_bctoolbox_ldlib.patch b/nixpkgs/pkgs/tools/audio/trx/add_bctoolbox_ldlib.patch
new file mode 100644
index 000000000000..1854a43a2493
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/trx/add_bctoolbox_ldlib.patch
@@ -0,0 +1,15 @@
+diff --git a/Makefile b/Makefile
+index ffcd883..c4b4ff7 100644
+--- a/Makefile
++++ b/Makefile
+@@ -12,8 +12,9 @@ CFLAGS += -MMD -Wall
+ LDLIBS_ASOUND ?= -lasound
+ LDLIBS_OPUS ?= -lopus
+ LDLIBS_ORTP ?= -lortp
++LDLIBS_BCTOOLBOX ?= -lbctoolbox
+ 
+-LDLIBS += $(LDLIBS_ASOUND) $(LDLIBS_OPUS) $(LDLIBS_ORTP)
++LDLIBS += $(LDLIBS_ASOUND) $(LDLIBS_OPUS) $(LDLIBS_ORTP) $(LDLIBS_BCTOOLBOX)
+ 
+ .PHONY:		all install dist clean
+ 
diff --git a/nixpkgs/pkgs/tools/audio/trx/default.nix b/nixpkgs/pkgs/tools/audio/trx/default.nix
new file mode 100644
index 000000000000..6a23b6caead4
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/trx/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchurl, alsaLib, libopus, ortp, bctoolbox }:
+
+stdenv.mkDerivation rec {
+  pname = "trx";
+  version = "0.5";
+
+  src = fetchurl {
+    url = "https://www.pogo.org.uk/~mark/trx/releases/${pname}-${version}.tar.gz";
+    sha256 = "1jjgca92nifjhcr3n0fmpfr6f5gxlqyal2wmgdlgd7hx834r1if7";
+  };
+
+  # Makefile is currently missing -lbctoolbox so the build fails when linking
+  # the libraries. This patch adds that flag.
+  patches = [
+    ./add_bctoolbox_ldlib.patch
+  ];
+
+  buildInputs = [ alsaLib libopus ortp bctoolbox ];
+  makeFlags = [ "PREFIX=$(out)" ];
+
+  meta = with stdenv.lib; {
+    description = "A simple toolset for broadcasting live audio using RTP/UDP and Opus";
+    homepage = "http://www.pogo.org.uk/~mark/trx/";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.hansjoergschurr ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/audio/tts/default.nix b/nixpkgs/pkgs/tools/audio/tts/default.nix
new file mode 100644
index 000000000000..770e898f2eec
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/tts/default.nix
@@ -0,0 +1,123 @@
+{ lib
+, python3Packages
+, fetchFromGitHub
+, fetchpatch
+, python3
+}:
+
+#
+# Tested in the following setup:
+#
+# TTS model:
+#   Tacotron2 DDC
+#   https://drive.google.com/drive/folders/1Y_0PcB7W6apQChXtbt6v3fAiNwVf4ER5
+# Vocoder model:
+#   Multi-Band MelGAN
+#   https://drive.google.com/drive/folders/1XeRT0q4zm5gjERJqwmX5w84pMrD00cKD
+#
+# Arrange /tmp/tts like this:
+#   scale_stats.npy
+#   tts
+#   tts/checkpoint_130000.pth.tar
+#   tts/checkpoint_130000_tf.pkl
+#   tts/checkpoint_130000_tf_2.3rc0.tflite
+#   tts/config.json
+#   tts/scale_stats.npy
+#   vocoder
+#   vocoder/checkpoint_1450000.pth.tar
+#   vocoder/checkpoint_2750000_tf.pkl
+#   vocoder/checkpoint_2750000_tf_v2.3rc.tflite
+#   vocoder/config.json
+#   vocoder/scale_stats.npy
+#
+# Start like this:
+#   cd /tmp/tts
+#   tts-server \
+#     --vocoder_config ./tts/vocoder/config.json \
+#     --vocoder_checkpoint ./tts/vocoder/checkpoint_1450000.pth.tar \
+#     --tts_config ./tts/config.json \
+#     --tts_checkpoint ./tts/checkpoint_130000.pth.tar
+#
+# For now, for deployment check the systemd unit in the pull request:
+#   https://github.com/NixOS/nixpkgs/pull/103851#issue-521121136
+#
+
+python3Packages.buildPythonApplication rec {
+  pname = "tts";
+  # until https://github.com/mozilla/TTS/issues/424 is resolved
+  # we treat released models as released versions:
+  # https://github.com/mozilla/TTS/wiki/Released-Models
+  version = "unstable-2020-06-17";
+
+  src = fetchFromGitHub {
+    owner = "mozilla";
+    repo = "TTS";
+    rev = "72a6ac54c8cfaa407fc64b660248c6a788bdd381";
+    sha256 = "1wvs264if9n5xzwi7ryxvwj1j513szp6sfj6n587xk1fphi0921f";
+  };
+
+  patches = [
+    (fetchpatch {
+      url = "https://github.com/mozilla/TTS/commit/36fee428b9f3f4ec1914b090a2ec9d785314d9aa.patch";
+      sha256 = "sha256-pP0NxiyrsvQ0A7GEleTdT87XO08o7WxPEpb6Bmj66dc=";
+    })
+  ];
+
+  preBuild = ''
+    # numba jit tries to write to its cache directory
+    export HOME=$TMPDIR
+    sed -i -e 's!tensorflow==.*!tensorflow!' requirements.txt
+    sed -i -e 's!librosa==[^"]*!librosa!' requirements.txt setup.py
+    sed -i -e 's!unidecode==[^"]*!unidecode!' requirements.txt setup.py
+    sed -i -e 's!bokeh==[^"]*!bokeh!' requirements.txt setup.py
+    sed -i -e 's!numba==[^"]*!numba!' requirements.txt setup.py
+    # Not required for building/installation but for their development/ci workflow
+    sed -i -e '/pylint/d' requirements.txt setup.py
+    sed -i -e '/cardboardlint/d' requirements.txt setup.py
+  '';
+
+
+  propagatedBuildInputs = with python3Packages; [
+    matplotlib
+    scipy
+    pytorch
+    flask
+    attrdict
+    bokeh
+    soundfile
+    tqdm
+    librosa
+    unidecode
+    phonemizer
+    tensorboardx
+    fuzzywuzzy
+    tensorflow_2
+    inflect
+    gdown
+    pysbd
+  ];
+
+  postInstall = ''
+    cp -r TTS/server/templates/ $out/${python3.sitePackages}/TTS/server
+  '';
+
+  checkInputs = with python3Packages; [ pytestCheckHook ];
+
+  disabledTests = [
+    # RuntimeError: fft: ATen not compiled with MKL support
+    "test_torch_stft"
+    "test_stft_loss"
+    "test_multiscale_stft_loss"
+    # AssertionErrors that I feel incapable of debugging
+    "test_phoneme_to_sequence"
+    "test_text2phone"
+    "test_parametrized_gan_dataset"
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/mozilla/TTS";
+    description = "Deep learning for Text to Speech";
+    license = licenses.mpl20;
+    maintainers = with maintainers; [ hexa mic92 ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/audio/video2midi/default.nix b/nixpkgs/pkgs/tools/audio/video2midi/default.nix
new file mode 100644
index 000000000000..cf9297119e9f
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/video2midi/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchFromGitHub, pythonPackages, opencv3 }:
+
+let
+  opencv3_ = pythonPackages.toPythonModule (opencv3.override {
+    inherit pythonPackages;
+    enablePython = true;
+    enableFfmpeg = true;
+  });
+in pythonPackages.buildPythonApplication rec {
+  pname = "video2midi";
+  version = "0.4.0.2";
+
+  format = "other";
+
+  src = fetchFromGitHub {
+    owner = "svsdval";
+    repo = pname;
+    rev = version;
+    sha256 = "174ijn8bc306529scd23szvgx1apanm2qmwk4lwmi64rhkm6dapx";
+  };
+
+  propagatedBuildInputs = with pythonPackages; [ opencv3_ midiutil pygame pyopengl ];
+
+  installPhase = ''
+    install -Dm755 v2m.py $out/bin/v2m.py
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Youtube synthesia video to midi conversion tool";
+    homepage = src.meta.homepage;
+    license = licenses.gpl3;
+    maintainers = [ maintainers.gnidorah ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/audio/volctl/default.nix b/nixpkgs/pkgs/tools/audio/volctl/default.nix
new file mode 100644
index 000000000000..1965fb083169
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/volctl/default.nix
@@ -0,0 +1,56 @@
+{ stdenv, python3Packages, fetchFromGitHub, wrapGAppsHook, gobject-introspection, libpulseaudio, glib, gtk3, pango, xorg }:
+
+python3Packages.buildPythonApplication rec {
+  pname = "volctl";
+  version = "0.8.0";
+
+  src = fetchFromGitHub {
+    owner = "buzz";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "02scfscf4mdrphzrd7cbwbhpig9bhvaws8qk4zc81z8vvf3mcfv2";
+  };
+
+  postPatch = ''
+    substituteInPlace volctl/lib/xwrappers.py \
+      --replace 'libXfixes.so' "${xorg.libXfixes}/lib/libXfixes.so" \
+      --replace 'libXfixes.so.3' "${xorg.libXfixes}/lib/libXfixes.so.3"
+  '';
+
+  preBuild = ''
+    export LD_LIBRARY_PATH=${libpulseaudio}/lib
+  '';
+
+  nativeBuildInputs = [
+    gobject-introspection
+    wrapGAppsHook
+  ];
+
+  propagatedBuildInputs = [ pango gtk3 ] ++ (with python3Packages; [
+    click
+    pycairo
+    pygobject3
+    pyyaml
+  ]);
+
+  # with strictDeps importing "gi.repository.Gtk" fails with "gi.RepositoryError: Typelib file for namespace 'Pango', version '1.0' not found"
+  strictDeps = false;
+
+  # no tests included
+  doCheck = false;
+
+  pythonImportsCheck = [ "volctl" ];
+
+  preFixup = ''
+    glib-compile-schemas ${glib.makeSchemaPath "$out" "${pname}-${version}"}
+    gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : "${libpulseaudio}/lib")
+  '';
+
+  meta = with stdenv.lib; {
+    description = "PulseAudio enabled volume control featuring per-app sliders";
+    homepage = "https://buzz.github.io/volctl/";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.romildo ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/audio/volumeicon/default.nix b/nixpkgs/pkgs/tools/audio/volumeicon/default.nix
new file mode 100644
index 000000000000..50290881dc77
--- /dev/null
+++ b/nixpkgs/pkgs/tools/audio/volumeicon/default.nix
@@ -0,0 +1,24 @@
+{ pkgs, fetchurl, stdenv, gtk3, pkgconfig, intltool, alsaLib }:
+
+stdenv.mkDerivation {
+  pname = "volumeicon";
+  version = "0.5.1";
+
+  src = fetchurl {
+    url = "http://softwarebakery.com/maato/files/volumeicon/volumeicon-0.5.1.tar.gz";
+    sha256 = "182xl2w8syv6ky2h2bc9imc6ap8pzh0p7rp63hh8nw0xm38c3f14";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ gtk3 intltool alsaLib ];
+
+  meta = with stdenv.lib; {
+    description = "A lightweight volume control that sits in your systray";
+    homepage = "http://softwarebakery.com/maato/volumeicon.html";
+    platforms = pkgs.lib.platforms.linux;
+    maintainers = with maintainers; [ bobvanderlinden ];
+    license = pkgs.lib.licenses.gpl3;
+  };
+
+}
+