diff --git a/tests/default.nix b/tests/default.nix index ad0733e..bb4d4ce 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -8,9 +8,21 @@ let nixOnDroidChannelURL = "file:///n-o-d/archive.tar.gz"; nixOnDroidFlakeURL = "/n-o-d/unpacked"; }; + + pkgs = nixpkgs.legacyPackages.${system}; + + runtimePackages = with pkgs; [ + coreutils + git + gnutar + gzip + unzip + wget + zip + ]; in -nixpkgs.legacyPackages.${system}.runCommand +pkgs.runCommand "fakedroid" { preferLocalBuild = true; @@ -20,6 +32,8 @@ nixpkgs.legacyPackages.${system}.runCommand install -D -m755 ${./fakedroid.sh} $out substituteInPlace $out \ + --subst-var-by bash "${pkgs.bash}" \ + --subst-var-by path "${pkgs.lib.makeBinPath runtimePackages}" \ --subst-var-by bootstrapZip "${bootstrap.customPkgs.bootstrapZip}" \ --subst-var-by prootTest "${bootstrap.customPkgs.prootTermuxTest}" \ --subst-var-by installationDir "${bootstrap.config.build.installationDir}" \ diff --git a/tests/fakedroid.sh b/tests/fakedroid.sh index 9ffb0f3..4d412f4 100644 --- a/tests/fakedroid.sh +++ b/tests/fakedroid.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!@bash@/bin/bash # This is a script to run "on-device" tests in CI, without the device. # Takes the bootstrap aarch64 zipball, unpacks, proots into it. @@ -8,6 +8,8 @@ set -ueo pipefail +PATH=@path@ + USE_FLAKE="${USE_FLAKE:-0}" if [[ ! "$USE_FLAKE" =~ ^[01]$ ]]; then echo "USE_FLAKE environment variable needs to be either 0 or 1, got '$USE_FLAKE'."