diff --git a/nixos/modules/services/audio/mopidy.nix b/nixos/modules/services/audio/mopidy.nix index d30c227db429..6fd7eae5b892 100644 --- a/nixos/modules/services/audio/mopidy.nix +++ b/nixos/modules/services/audio/mopidy.nix @@ -13,11 +13,11 @@ let mopidyEnv = buildEnv { name = "mopidy-with-extensions-${mopidy.version}"; paths = closePropagation cfg.extensionPackages; - pathsToLink = [ "/${python3.sitePackages}" ]; + pathsToLink = [ "/${mopidyPackages.python.sitePackages}" ]; buildInputs = [ makeWrapper ]; postBuild = '' makeWrapper ${mopidy}/bin/mopidy $out/bin/mopidy \ - --prefix PYTHONPATH : $out/${python3.sitePackages} + --prefix PYTHONPATH : $out/${mopidyPackages.python.sitePackages} ''; }; in { diff --git a/pkgs/applications/audio/mopidy/default.nix b/pkgs/applications/audio/mopidy/default.nix new file mode 100644 index 000000000000..0b9f81533020 --- /dev/null +++ b/pkgs/applications/audio/mopidy/default.nix @@ -0,0 +1,41 @@ +{ newScope, python }: + +# Create a custom scope so we are consistent in which python version is used + +let + callPackage = newScope self; + + self = { + + inherit python; + pythonPackages = python.pkgs; + + mopidy = callPackage ./mopidy.nix { }; + + mopidy-gmusic = callPackage ./gmusic.nix { }; + + mopidy-local-images = callPackage ./local-images.nix { }; + + mopidy-local-sqlite = callPackage ./local-sqlite.nix { }; + + mopidy-spotify = callPackage ./spotify.nix { }; + + mopidy-moped = callPackage ./moped.nix { }; + + mopidy-mopify = callPackage ./mopify.nix { }; + + mopidy-mpd = callPackage ./mpd.nix { }; + + mopidy-spotify-tunigo = callPackage ./spotify-tunigo.nix { }; + + mopidy-youtube = callPackage ./youtube.nix { }; + + mopidy-soundcloud = callPackage ./soundcloud.nix { }; + + mopidy-musicbox-webclient = callPackage ./musicbox-webclient.nix { }; + + mopidy-iris = callPackage ./iris.nix { }; + + }; + +in self diff --git a/pkgs/applications/audio/mopidy/mopidy.nix b/pkgs/applications/audio/mopidy/mopidy.nix index 66be35bfcc8f..ae65d9b2f6ed 100644 --- a/pkgs/applications/audio/mopidy/mopidy.nix +++ b/pkgs/applications/audio/mopidy/mopidy.nix @@ -1,8 +1,8 @@ -{ stdenv, fetchFromGitHub, python3Packages, wrapGAppsHook +{ stdenv, fetchFromGitHub, pythonPackages, wrapGAppsHook , gst_all_1, glib-networking, gobject-introspection }: -python3Packages.buildPythonApplication rec { +pythonPackages.buildPythonApplication rec { pname = "mopidy"; version = "3.0.2"; @@ -20,7 +20,7 @@ python3Packages.buildPythonApplication rec { glib-networking gobject-introspection ]; - propagatedBuildInputs = with python3Packages; [ + propagatedBuildInputs = with pythonPackages; [ gst-python pygobject3 pykka tornado_4 requests setuptools ] ++ stdenv.lib.optional (!stdenv.isDarwin) dbus-python; diff --git a/pkgs/applications/audio/mopidy/spotify.nix b/pkgs/applications/audio/mopidy/spotify.nix index 0793ae01c29e..32019c74f86d 100644 --- a/pkgs/applications/audio/mopidy/spotify.nix +++ b/pkgs/applications/audio/mopidy/spotify.nix @@ -1,6 +1,6 @@ -{ stdenv, fetchurl, python3Packages, mopidy }: +{ stdenv, fetchurl, pythonPackages, mopidy }: -python3Packages.buildPythonApplication rec { +pythonPackages.buildPythonApplication rec { pname = "mopidy-spotify"; version = "4.0.1"; @@ -9,7 +9,7 @@ python3Packages.buildPythonApplication rec { sha256 = "1ac8r8050i5r3ag1hlblbcyskqjqz7wgamndbzsmw52qi6hxk44f"; }; - propagatedBuildInputs = [ mopidy python3Packages.pyspotify ]; + propagatedBuildInputs = [ mopidy pythonPackages.pyspotify ]; doCheck = false; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index dd6de8b65624..47b04e5ebc38 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -20640,31 +20640,11 @@ in mop = callPackage ../applications/misc/mop { }; - mopidy = callPackage ../applications/audio/mopidy/mopidy.nix { }; + mopidyPackages = callPackages ../applications/audio/mopidy/default.nix { + python = python3; + }; - mopidy-gmusic = callPackage ../applications/audio/mopidy/gmusic.nix { }; - - mopidy-local-images = callPackage ../applications/audio/mopidy/local-images.nix { }; - - mopidy-local-sqlite = callPackage ../applications/audio/mopidy/local-sqlite.nix { }; - - mopidy-spotify = callPackage ../applications/audio/mopidy/spotify.nix { }; - - mopidy-moped = callPackage ../applications/audio/mopidy/moped.nix { }; - - mopidy-mopify = callPackage ../applications/audio/mopidy/mopify.nix { }; - - mopidy-spotify-tunigo = callPackage ../applications/audio/mopidy/spotify-tunigo.nix { }; - - mopidy-youtube = callPackage ../applications/audio/mopidy/youtube.nix { }; - - mopidy-soundcloud = callPackage ../applications/audio/mopidy/soundcloud.nix { }; - - mopidy-musicbox-webclient = callPackage ../applications/audio/mopidy/musicbox-webclient.nix { }; - - mopidy-iris = callPackage ../applications/audio/mopidy/iris.nix { }; - - mopidy-mpd = callPackage ../applications/audio/mopidy/mpd.nix { }; + inherit (mopidyPackages) mopidy mopidy-gmusic mopidy-local-images mopidy-local-sqlite mopidy-spotify mopidy-moped mopidy-mopify mopidy-spotify-tunigo mopidy-youtube mopidy-soundcloud mopidy-musicbox-webclient mopidy-iris mopidy-mpd; motif = callPackage ../development/libraries/motif { };