mirror of
https://github.com/nix-community/nix-on-droid.git
synced 2025-11-08 19:46:07 +01:00
tests: update flake tests to use new --flake argument
This commit is contained in:
parent
248632699e
commit
e687e46e2f
4 changed files with 15 additions and 23 deletions
|
|
@ -13,14 +13,8 @@ load lib
|
||||||
_sed "s|<<FLAKE_URL>>|$FLAKE_URL|g" \
|
_sed "s|<<FLAKE_URL>>|$FLAKE_URL|g" \
|
||||||
"$ON_DEVICE_TESTS_DIR/config-flake-h-m.flake.nix" \
|
"$ON_DEVICE_TESTS_DIR/config-flake-h-m.flake.nix" \
|
||||||
> ~/.config/nixpkgs/flake.nix
|
> ~/.config/nixpkgs/flake.nix
|
||||||
pushd ~/.config/nixpkgs
|
|
||||||
nix-shell -p nixFlakes --run \
|
nix-on-droid switch --flake ~/.config/nixpkgs#device
|
||||||
'nix build \
|
|
||||||
--extra-experimental-features nix-command \
|
|
||||||
--extra-experimental-features flakes \
|
|
||||||
--impure .#nix-on-droid'
|
|
||||||
result/activate
|
|
||||||
popd
|
|
||||||
|
|
||||||
# test presence of several crucial commands
|
# test presence of several crucial commands
|
||||||
assert_command nix-on-droid nix-shell bash
|
assert_command nix-on-droid nix-shell bash
|
||||||
|
|
|
||||||
|
|
@ -5,15 +5,16 @@
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/release-21.11";
|
nixpkgs.url = "github:NixOS/nixpkgs/release-21.11";
|
||||||
home-manager.url = "github:nix-community/home-manager/release-21.11";
|
home-manager.url = "github:nix-community/home-manager/release-21.11";
|
||||||
nix-on-droid.url = "<<FLAKE_URL>>";
|
nix-on-droid.url = "<<FLAKE_URL>>";
|
||||||
|
|
||||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
nix-on-droid.inputs.nixpkgs.follows = "nixpkgs";
|
nix-on-droid.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
nix-on-droid.inputs.home-manager.follows = "home-manager";
|
nix-on-droid.inputs.home-manager.follows = "home-manager";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { nix-on-droid, ... }: {
|
outputs = { nix-on-droid, ... }: {
|
||||||
nix-on-droid = (nix-on-droid.lib.aarch64-linux.nix-on-droid {
|
nixOnDroidConfigurations = {
|
||||||
config = /data/data/com.termux.nix/files/home/.config/nixpkgs/nix-on-droid.nix;
|
device = nix-on-droid.lib.nixOnDroidConfiguration {
|
||||||
}).activationPackage;
|
config = ./nix-on-droid.nix;
|
||||||
|
system = "aarch64-linux";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,13 +18,7 @@ load lib
|
||||||
"$ON_DEVICE_TESTS_DIR/config-flake.nix" \
|
"$ON_DEVICE_TESTS_DIR/config-flake.nix" \
|
||||||
> ~/.config/nixpkgs/flake.nix
|
> ~/.config/nixpkgs/flake.nix
|
||||||
|
|
||||||
# this is more cumbersome than options,
|
nix-on-droid switch --flake ~/.config/nixpkgs#device
|
||||||
# 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
|
|
||||||
|
|
||||||
# test presence of several crucial commands
|
# test presence of several crucial commands
|
||||||
assert_command nix-on-droid nix-shell bash
|
assert_command nix-on-droid nix-shell bash
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,11 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { nix-on-droid, ... }: {
|
outputs = { nix-on-droid, ... }: {
|
||||||
nix-on-droid = (nix-on-droid.lib.aarch64-linux.nix-on-droid {
|
nixOnDroidConfigurations = {
|
||||||
config = /data/data/com.termux.nix/files/home/.config/nixpkgs/nix-on-droid.nix;
|
device = nix-on-droid.lib.nixOnDroidConfiguration {
|
||||||
}).activationPackage;
|
config = ./nix-on-droid.nix;
|
||||||
|
system = "aarch64-linux";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue