about summary refs log tree commit diff
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2015-12-18 05:34:46 +0100
committeraszlig <aszlig@redmoonstudios.org>2015-12-18 05:58:27 +0100
commit662ab05119e88f70d6b43518bffec0bca4bdb474 (patch)
tree2b0a0c8a0eb2c347890b0e86154b4376820a40f8
parentec3d068170a5e29731655e7fc94a4f8a8d9ba8a1 (diff)
downloadnixlib-662ab05119e88f70d6b43518bffec0bca4bdb474.tar
nixlib-662ab05119e88f70d6b43518bffec0bca4bdb474.tar.gz
nixlib-662ab05119e88f70d6b43518bffec0bca4bdb474.tar.bz2
nixlib-662ab05119e88f70d6b43518bffec0bca4bdb474.tar.lz
nixlib-662ab05119e88f70d6b43518bffec0bca4bdb474.tar.xz
nixlib-662ab05119e88f70d6b43518bffec0bca4bdb474.tar.zst
nixlib-662ab05119e88f70d6b43518bffec0bca4bdb474.zip
beets: Add the external beets-alternatives plugin
It's not included in upstream beets but are linked in the documentation
under "Other plugins", see:

http://beets.readthedocs.org/en/v1.3.15/plugins/index.html#other-plugins

I found this one particularly useful for syncing files to varios media
players that refuse to read my FLAC files properly.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
-rw-r--r--pkgs/tools/audio/beets/alternatives-plugin.nix25
-rw-r--r--pkgs/tools/audio/beets/default.nix8
2 files changed, 32 insertions, 1 deletions
diff --git a/pkgs/tools/audio/beets/alternatives-plugin.nix b/pkgs/tools/audio/beets/alternatives-plugin.nix
new file mode 100644
index 000000000000..1b0c9b3992b9
--- /dev/null
+++ b/pkgs/tools/audio/beets/alternatives-plugin.nix
@@ -0,0 +1,25 @@
+{ stdenv, buildPythonPackage, fetchFromGitHub, pythonPackages }:
+
+buildPythonPackage rec {
+  name = "beets-alternatives-${version}";
+  version = "0.8.2";
+
+  src = fetchFromGitHub {
+    repo = "beets-alternatives";
+    owner = "geigerzaehler";
+    rev = "v${version}";
+    sha256 = "10za6h59pxa13y8i4amqhc6392csml0dl771lssv6b6a98kamsy7";
+  };
+
+  postPatch = ''
+    sed -i -e '/install_requires/,/\]/{/beets/d}' setup.py
+  '';
+
+  propagatedBuildInputs = with pythonPackages; [ futures ];
+
+  meta = {
+    description = "Beets plugin to manage external files";
+    homepage = "https://github.com/geigerzaehler/beets-alternatives";
+    license = stdenv.lib.licenses.mit;
+  };
+}
diff --git a/pkgs/tools/audio/beets/default.nix b/pkgs/tools/audio/beets/default.nix
index 7a678148944c..35a69262acde 100644
--- a/pkgs/tools/audio/beets/default.nix
+++ b/pkgs/tools/audio/beets/default.nix
@@ -12,6 +12,9 @@
 , enableThumbnails ? true
 , enableWeb        ? true
 
+# External plugins
+, enableAlternatives ? false
+
 , bashInteractive, bashCompletion
 }:
 
@@ -91,7 +94,10 @@ in buildPythonPackage rec {
     ++ optional enableLastfm     pythonPackages.pylast
     ++ optional enableMpd        pythonPackages.mpd
     ++ optional enableThumbnails pythonPackages.pyxdg
-    ++ optional enableWeb        pythonPackages.flask;
+    ++ optional enableWeb        pythonPackages.flask
+    ++ optional enableAlternatives (import ./alternatives-plugin.nix {
+      inherit stdenv buildPythonPackage pythonPackages fetchFromGitHub;
+    });
 
   buildInputs = with pythonPackages; [
     beautifulsoup4