23ee554f2f
Also adds some documentation to celebrate that we can now - with ease - verbally distinguish between composition-level modules and service-level modules.
34 lines
997 B
Nix
34 lines
997 B
Nix
{ pkgs, ... }:
|
|
|
|
let
|
|
# To make some prebuilt derivations available in the vm
|
|
preEval = import ../../src/nix/eval-composition.nix {
|
|
modules = [ ../../examples/minimal/arion-compose.nix ];
|
|
inherit pkgs;
|
|
};
|
|
in
|
|
{
|
|
name = "arion-test";
|
|
machine = { pkgs, lib, ... }: {
|
|
environment.systemPackages = [
|
|
pkgs.arion
|
|
pkgs.docker-compose
|
|
];
|
|
virtualisation.docker.enable = true;
|
|
|
|
# no caches, because no internet
|
|
nix.binaryCaches = lib.mkForce [];
|
|
virtualisation.writableStore = true;
|
|
virtualisation.pathsInNixDB = [
|
|
# Pre-build the image because we don't want to build the world
|
|
# in the vm.
|
|
preEval.config.build.dockerComposeYaml
|
|
];
|
|
};
|
|
testScript = ''
|
|
$machine->fail("curl localhost:8000");
|
|
$machine->succeed("docker --version");
|
|
$machine->succeed("cp -r ${../../examples/minimal} work && cd work && NIX_PATH=nixpkgs='${pkgs.path}' arion up -d");
|
|
$machine->waitUntilSucceeds("curl localhost:8000");
|
|
'';
|
|
}
|