Merge pull request #132 from mkg20001/nix

Add nixos derivation
This commit is contained in:
Casu Al Snek 2024-01-09 09:12:53 +05:45 committed by GitHub
commit b12c06568c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 1 deletions

5
.gitignore vendored
View file

@ -105,4 +105,7 @@ venv.bak/
# mypy
.mypy_cache/
test.py
# nix
result*
test.py

22
default.nix Normal file
View file

@ -0,0 +1,22 @@
with (import <nixpkgs> {});
stdenv.mkDerivation {
name = "waydroid_script";
buildInputs = [
(python3.withPackages(ps: with ps; [ tqdm requests inquirerpy ]))
];
src = ./.;
postPatch = ''
patchShebangs main.py
'';
installPhase = ''
mkdir -p $out/libexec
cp -r . $out/libexec/waydroid_script
mkdir -p $out/bin
ln -s $out/libexec/waydroid_script/main.py $out/bin/waydroid_script
'';
}