summary refs log tree commit diff
path: root/pkgs/common-updater/scripts.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/common-updater/scripts.nix')
-rw-r--r--pkgs/common-updater/scripts.nix32
1 files changed, 29 insertions, 3 deletions
diff --git a/pkgs/common-updater/scripts.nix b/pkgs/common-updater/scripts.nix
index 26c77e87636..d5ee3b58c50 100644
--- a/pkgs/common-updater/scripts.nix
+++ b/pkgs/common-updater/scripts.nix
@@ -1,9 +1,28 @@
-{ lib, stdenv, makeWrapper, coreutils, gnused, gnugrep, diffutils, nix, git, jq }:
+{ lib
+, stdenv
+, makeWrapper
+, coreutils
+, diffutils
+, git
+, gnugrep
+, gnused
+, jq
+, nix
+, python3Packages
+}:
 
 stdenv.mkDerivation {
   name = "common-updater-scripts";
 
-  nativeBuildInputs = [ makeWrapper ];
+  nativeBuildInputs = [
+    makeWrapper
+    python3Packages.wrapPython
+  ];
+
+  pythonPath = [
+    python3Packages.beautifulsoup4
+    python3Packages.requests
+  ];
 
   dontUnpack = true;
 
@@ -11,8 +30,15 @@ stdenv.mkDerivation {
     mkdir -p $out/bin
     cp ${./scripts}/* $out/bin
 
+    # wrap non python scripts
     for f in $out/bin/*; do
-      wrapProgram $f --prefix PATH : ${lib.makeBinPath [ coreutils gnused gnugrep nix diffutils git jq ]}
+      if ! (head -n1 "$f" | grep -q '#!.*/env.*\(python\|pypy\)'); then
+        wrapProgram $f --prefix PATH : ${lib.makeBinPath [ coreutils diffutils git gnugrep gnused jq nix ]}
+      fi
     done
+
+    # wrap python scripts
+    makeWrapperArgs+=( --prefix PATH : "${lib.makeBinPath [ nix ]}" )
+    wrapPythonPrograms
   '';
 }