diff --git a/tests/on-device/config-flake-h-m.bats b/tests/on-device/config-flake-h-m.bats index 7aebb4c..92841cb 100644 --- a/tests/on-device/config-flake-h-m.bats +++ b/tests/on-device/config-flake-h-m.bats @@ -13,14 +13,8 @@ load lib _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 \ - --extra-experimental-features nix-command \ - --extra-experimental-features flakes \ - --impure .#nix-on-droid' - result/activate - popd + + nix-on-droid switch --flake ~/.config/nixpkgs#device # test presence of several crucial commands assert_command nix-on-droid nix-shell bash diff --git a/tests/on-device/config-flake-h-m.flake.nix b/tests/on-device/config-flake-h-m.flake.nix index a1fc04c..a3bc9d2 100644 --- a/tests/on-device/config-flake-h-m.flake.nix +++ b/tests/on-device/config-flake-h-m.flake.nix @@ -5,15 +5,16 @@ nixpkgs.url = "github:NixOS/nixpkgs/release-21.11"; home-manager.url = "github:nix-community/home-manager/release-21.11"; nix-on-droid.url = "<>"; - - home-manager.inputs.nixpkgs.follows = "nixpkgs"; nix-on-droid.inputs.nixpkgs.follows = "nixpkgs"; nix-on-droid.inputs.home-manager.follows = "home-manager"; }; outputs = { nix-on-droid, ... }: { - nix-on-droid = (nix-on-droid.lib.aarch64-linux.nix-on-droid { - config = /data/data/com.termux.nix/files/home/.config/nixpkgs/nix-on-droid.nix; - }).activationPackage; + nixOnDroidConfigurations = { + device = nix-on-droid.lib.nixOnDroidConfiguration { + config = ./nix-on-droid.nix; + system = "aarch64-linux"; + }; + }; }; } diff --git a/tests/on-device/config-flake.bats b/tests/on-device/config-flake.bats index 6daafc6..5f8e6b8 100644 --- a/tests/on-device/config-flake.bats +++ b/tests/on-device/config-flake.bats @@ -18,13 +18,7 @@ load lib "$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 - echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf - pushd ~/.config/nixpkgs - nix-shell -p nixFlakes --run 'nix build .#nix-on-droid --impure' - result/activate - popd + nix-on-droid switch --flake ~/.config/nixpkgs#device # test presence of several crucial commands assert_command nix-on-droid nix-shell bash diff --git a/tests/on-device/config-flake.nix b/tests/on-device/config-flake.nix index 357b720..8dbd87e 100644 --- a/tests/on-device/config-flake.nix +++ b/tests/on-device/config-flake.nix @@ -8,8 +8,11 @@ }; outputs = { nix-on-droid, ... }: { - nix-on-droid = (nix-on-droid.lib.aarch64-linux.nix-on-droid { - config = /data/data/com.termux.nix/files/home/.config/nixpkgs/nix-on-droid.nix; - }).activationPackage; + nixOnDroidConfigurations = { + device = nix-on-droid.lib.nixOnDroidConfiguration { + config = ./nix-on-droid.nix; + system = "aarch64-linux"; + }; + }; }; }