1{
2 lib,
3 stdenv,
4 makeWrapper,
5 coreutils,
6 diffutils,
7 git,
8 gnugrep,
9 gnused,
10 jq,
11 nix,
12 python3Packages,
13}:
14
15stdenv.mkDerivation {
16 name = "common-updater-scripts";
17
18 nativeBuildInputs = [
19 makeWrapper
20 python3Packages.wrapPython
21 ];
22
23 pythonPath = [
24 python3Packages.beautifulsoup4
25 python3Packages.requests
26 ];
27
28 dontUnpack = true;
29
30 installPhase = ''
31 mkdir -p $out/bin
32 cp ${./scripts}/* $out/bin
33
34 # wrap non python scripts
35 for f in $out/bin/*; do
36 if ! (head -n1 "$f" | grep -q '#!.*/env.*\(python\|pypy\)'); then
37 wrapProgram $f --prefix PATH : ${
38 lib.makeBinPath [
39 coreutils
40 diffutils
41 git
42 gnugrep
43 gnused
44 jq
45 nix
46 ]
47 }
48 fi
49 done
50
51 # wrap python scripts
52 makeWrapperArgs+=( --prefix PATH : "${lib.makeBinPath [ nix ]}" )
53 wrapPythonPrograms
54 '';
55}