diff --git a/tests/on-device/config-flake-h-m.bats b/tests/on-device/config-flake-h-m.bats index 2be3e49..7aebb4c 100644 --- a/tests/on-device/config-flake-h-m.bats +++ b/tests/on-device/config-flake-h-m.bats @@ -10,10 +10,9 @@ load lib # set up / build / activate the configuration cat "$ON_DEVICE_TESTS_DIR/config-flake-h-m.cfg.nix" \ > ~/.config/nixpkgs/nix-on-droid.nix - nix-shell -p gnused --run \ - "sed 's|<>|$FLAKE_URL|g' \ - < '$ON_DEVICE_TESTS_DIR/config-flake-h-m.flake.nix' \ - > ~/.config/nixpkgs/flake.nix" + _sed "s|<>|$FLAKE_URL|g" \ + "$ON_DEVICE_TESTS_DIR/config-flake-h-m.flake.nix" \ + > ~/.config/nixpkgs/flake.nix pushd ~/.config/nixpkgs nix-shell -p nixFlakes --run \ 'nix build \ diff --git a/tests/on-device/config-flake.bats b/tests/on-device/config-flake.bats index 08c1107..6daafc6 100644 --- a/tests/on-device/config-flake.bats +++ b/tests/on-device/config-flake.bats @@ -8,17 +8,15 @@ load lib assert_no_command unzip # set up / build / activate the configuration - nix-shell -p gnused --run \ - "sed \ - -e s/vim/nano/ \ - -e s/#unzip/unzip/ \ - < '$CHANNEL_DIR/modules/environment/login/nix-on-droid.nix.default' \ - > ~/.config/nixpkgs/nix-on-droid.nix" + _sed \ + -e 's/vim/nano/' \ + -e 's/#unzip/unzip/' \ + "$CHANNEL_DIR/modules/environment/login/nix-on-droid.nix.default" \ + > ~/.config/nixpkgs/nix-on-droid.nix - nix-shell -p gnused --run \ - "sed 's|<>|$FLAKE_URL|g' \ - < '$ON_DEVICE_TESTS_DIR/config-flake.nix' \ - > ~/.config/nixpkgs/flake.nix" + _sed "s|<>|$FLAKE_URL|g" \ + "$ON_DEVICE_TESTS_DIR/config-flake.nix" \ + > ~/.config/nixpkgs/flake.nix # this is more cumbersome than options, # but this is what we recommend to users, so taking the hard way diff --git a/tests/on-device/gnumake.bats b/tests/on-device/gnumake.bats index 97dd946..6d116dd 100644 --- a/tests/on-device/gnumake.bats +++ b/tests/on-device/gnumake.bats @@ -4,7 +4,9 @@ TEMPDIR=/tmp/.tmp-gnumake.$$ mkdir -p "$TEMPDIR" echo -e 'x:\n\techo desired output > x' > "$TEMPDIR/Makefile" - nix-shell -p gnumake --run "make -C $TEMPDIR x" + + "$(nix-build "" --no-out-link --attr gnumake)/bin/make" -C "$TEMPDIR" x + [[ -e "$TEMPDIR/x" ]] [[ "$(cat "$TEMPDIR/x")" == 'desired output' ]] } diff --git a/tests/on-device/lib.bash b/tests/on-device/lib.bash index f597be7..8057249 100644 --- a/tests/on-device/lib.bash +++ b/tests/on-device/lib.bash @@ -51,3 +51,9 @@ switch_to_default_config() { > ~/.config/nixpkgs/nix-on-droid.nix nix-on-droid switch } + +_sed() { + local storePath + storePath="$(nix-build "" --no-out-link --attr gnused)" + "${storePath}/bin/sed" "$@" +}