summary refs log tree commit diff
path: root/nixos/tests/run-in-machine.nix
blob: a6dfece44a92e0b14bb015070377c54a955871e2 (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 = { config, pkgs, ... }: { /* 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"
''