nixpkgs/nixos/tests/crabfit.nix

32 lines
598 B
Nix
Raw Permalink Normal View History

{ lib, pkgs, ... }:
2024-04-02 12:16:53 +02:00
{
name = "crabfit";
2024-04-02 12:16:53 +02:00
meta.maintainers = [ ];
2024-04-02 12:16:53 +02:00
nodes = {
machine =
{ pkgs, ... }:
{
services.crabfit = {
enable = true;
2024-04-02 12:16:53 +02:00
frontend.host = "http://127.0.0.1:3001";
api.host = "127.0.0.1:3000";
2024-04-02 12:16:53 +02:00
};
};
};
2024-04-02 12:16:53 +02:00
# TODO: Add a reverse proxy and a dns entry for testing
testScript = ''
machine.wait_for_unit("crabfit-api")
machine.wait_for_unit("crabfit-frontend")
2024-04-02 12:16:53 +02:00
machine.wait_for_open_port(3000)
machine.wait_for_open_port(3001)
2024-04-02 12:16:53 +02:00
machine.succeed("curl -f http://localhost:3001/")
'';
}