Add Nix flake and improve derivation

This adds a Nix flake to the repo as well as updates the derivation so
that it includes `lzip` as a dependency
This commit was merged in pull request #150.
This commit is contained in:
NullBite
2025-11-17 10:08:53 +01:00
committed by Alessandro Astone
parent 15020ec20a
commit ddaa6b190f
4 changed files with 98 additions and 22 deletions
+32
View File
@@ -0,0 +1,32 @@
{ lib,
stdenvNoCC,
lzip,
python3,
makeWrapper }:
let
wrappedPath = lib.makeBinPath [ lzip ];
in stdenvNoCC.mkDerivation {
name = "waydroid_script";
buildInputs = [
(python3.withPackages(ps: with ps; [ tqdm requests inquirerpy ]))
];
nativeBuildInputs = [
makeWrapper
];
src = ./.;
postPatch = ''
patchShebangs main.py
'';
installPhase = ''
mkdir -p $out/libexec
cp -r . $out/libexec/waydroid_script
mkdir -p $out/bin
makeShellWrapper $out/libexec/waydroid_script/main.py $out/bin/waydroid_script \
--prefix PATH : "${wrappedPath}"
'';
}