tests: update flake tests to use new --flake argument

This commit is contained in:
Tobias Happ 2021-12-12 17:15:53 +01:00
parent 248632699e
commit e687e46e2f
4 changed files with 15 additions and 23 deletions

View file

@ -13,14 +13,8 @@ load lib
_sed "s|<<FLAKE_URL>>|$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

View file

@ -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 = "<<FLAKE_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";
};
};
};
}

View file

@ -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

View file

@ -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";
};
};
};
}