1 import ./make-test-python.nix (
5 meta.maintainers = [ lib.maintainers.rizary ];
8 server = { pkgs, ... }: {
11 virtualHosts.default.root = "/var/www";
13 services.nar-serve = {
15 # Connect to the localhost nginx instead of the default
16 # https://cache.nixos.org
17 cacheURL = "http://localhost/";
19 environment.systemPackages = [
24 networking.firewall.allowedTCPPorts = [ 8383 ];
26 # virtualisation.diskSize = 2 * 1024;
34 # Create a fake cache with Nginx service the static files
36 "nix --experimental-features nix-command copy --to file:///var/www ${pkgs.hello}"
38 server.wait_for_unit("nginx.service")
39 server.wait_for_open_port(80)
41 # Check that nar-serve can return the content of the derivation
42 drvName = os.path.basename("${pkgs.hello}")
43 drvHash = drvName.split("-")[0]
44 server.wait_for_unit("nar-serve.service")
46 "curl -o hello -f http://localhost:8383/nix/store/{}/bin/hello".format(drvHash)