blob: 64f92b84da51191daba19a24d685341bee69bfd0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
{ config, ... }:
{
name = "nix-serve";
nodes.machine =
{ pkgs, ... }:
{
services.nix-serve.enable = true;
environment.systemPackages = [
pkgs.hello
];
nix.enable = true; # disabled by default. See all-tests.nix / tag(no-nix-by-default)
};
testScript =
let
pkgHash = builtins.head (
builtins.match "${builtins.storeDir}/([^-]+).+" (toString config.node.pkgs.hello)
);
in
''
start_all()
machine.wait_for_unit("nix-serve.service")
machine.wait_for_open_port(5000)
machine.succeed(
"curl --fail -g http://0.0.0.0:5000/nar/${pkgHash}.nar -o /tmp/hello.nar"
)
'';
}
|