32 lines
681 B
Nix
32 lines
681 B
Nix
|
{ nixpkgs, jwt-tool }:
|
||
|
let
|
||
|
python = (nixpkgs.python3.withPackages (p: with p; [ termcolor pycryptodomex requests ]));
|
||
|
in
|
||
|
nixpkgs.python3Packages.buildPythonApplication
|
||
|
{
|
||
|
format = "other";
|
||
|
pname = "jwt-tool";
|
||
|
version = "v2.2.4";
|
||
|
propagatedBuildInputs = [ python ];
|
||
|
src = jwt-tool.outPath;
|
||
|
buildPhase = ''
|
||
|
chmod +x jwt_tool.py
|
||
|
'';
|
||
|
postPatch = ''
|
||
|
patchShebangs .
|
||
|
'';
|
||
|
installPhase = ''
|
||
|
mkdir -p $out/bin
|
||
|
mv * $out
|
||
|
ln -s $out/jwt_tool.py $out/bin/jwt_tool
|
||
|
chmod +x $out/bin/jwt_tool
|
||
|
for i in "$out/bin/"*
|
||
|
|
||
|
do
|
||
|
wrapProgram "$i" --prefix PYTHONPATH : \
|
||
|
"$out/${python.sitePackages}" || \
|
||
|
exit 2
|
||
|
done
|
||
|
'';
|
||
|
}
|