about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/tautulli/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/servers/tautulli/default.nix')
-rw-r--r--nixpkgs/pkgs/servers/tautulli/default.nix53
1 files changed, 53 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/servers/tautulli/default.nix b/nixpkgs/pkgs/servers/tautulli/default.nix
new file mode 100644
index 000000000000..fb2a67353606
--- /dev/null
+++ b/nixpkgs/pkgs/servers/tautulli/default.nix
@@ -0,0 +1,53 @@
+{ lib, fetchFromGitHub, buildPythonApplication, setuptools, wrapPython, makeWrapper }:
+
+buildPythonApplication rec {
+  pname = "Tautulli";
+  version = "2.13.4";
+  format = "other";
+
+  pythonPath = [ setuptools ];
+  nativeBuildInputs = [ wrapPython makeWrapper ];
+
+  src = fetchFromGitHub {
+    owner = "Tautulli";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-cOHirjYdfPPv7O9o3vnsKBffvqxoaRN32NaUOK0SmQ8=";
+  };
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/bin $out/libexec/tautulli
+    cp -R contrib data lib plexpy Tautulli.py CHANGELOG.md $out/libexec/tautulli
+
+    echo "master" > $out/libexec/tautulli/branch.txt
+    echo "v${version}" > $out/libexec/tautulli/version.txt
+
+    # Can't just symlink to the main script, since it uses __file__ to
+    # import bundled packages and manage the service
+    makeWrapper $out/libexec/tautulli/Tautulli.py $out/bin/tautulli
+    wrapPythonProgramsIn "$out/libexec/tautulli" "$pythonPath"
+
+    # Creat backwards compatibility symlink to bin/plexpy
+    ln -s $out/bin/tautulli $out/bin/plexpy
+
+    runHook postInstall
+  '';
+
+  checkPhase = ''
+    runHook preCheck
+
+    $out/bin/tautulli --help
+
+    runHook postCheck
+  '';
+
+  meta  = with lib; {
+    description = "A Python based monitoring and tracking tool for Plex Media Server";
+    homepage = "https://tautulli.com/";
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ rhoriguchi ];
+  };
+}