summary refs log tree commit diff
path: root/nixos/tests/run-in-machine.nix
blob: bd90dc3080bd9b8e16c2632395d223fc3ab3f1e9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{ system ? builtins.currentSystem }:

with import ../lib/testing.nix { inherit system; };

let
  output = runInMachine {
    drv = pkgs.hello;
    machine = { ... }: { /* services.sshd.enable = true; */ };
  };
in pkgs.runCommand "verify-output" { inherit output; } ''
  if [ ! -e "$output/bin/hello" ]; then
    echo "Derivation built using runInMachine produced incorrect output:" >&2
    ls -laR "$output" >&2
    exit 1
  fi
  "$output/bin/hello" > "$out"
''