Skip to content

Commit

Permalink
nixos/nixos-enter: Test nix-build in nixos-enter
Browse files Browse the repository at this point in the history
  • Loading branch information
chkno committed Feb 21, 2020
1 parent 71ce290 commit 231467a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions nixos/tests/installer.nix
Expand Up @@ -133,6 +133,19 @@ let
machine.succeed("nixos-enter -- touch /nixos-enter-works")
machine.succeed("[[ -e /mnt/nixos-enter-works ]]")
with subtest("Can build things in the installed environment"):
machine.succeed(
"""
nixos-enter -- nix-build --option substitute false -E 'derivation {
name = "t";
builder = "/bin/sh";
args = ["-c" "echo nixos-enter build > $out"];
system = builtins.currentSystem;
preferLocalBuild = true;
}'
"""
)
with subtest("Shutdown system after installation"):
machine.succeed("umount /mnt/boot || true")
machine.succeed("umount /mnt")
Expand Down

0 comments on commit 231467a

Please sign in to comment.