1{ pkgs, lib, ... }:
2{
3 name = "haste-server";
4 meta.maintainers = with lib.maintainers; [ mkg20001 ];
5
6 nodes.machine =
7 { pkgs, ... }:
8 {
9 environment.systemPackages = with pkgs; [
10 curl
11 jq
12 ];
13
14 services.haste-server = {
15 enable = true;
16 };
17 };
18
19 testScript = ''
20 machine.wait_for_unit("haste-server")
21 machine.wait_until_succeeds("curl -s localhost:7777")
22 machine.succeed('curl -s -X POST http://localhost:7777/documents -d "Hello World!" > bla')
23 machine.succeed('curl http://localhost:7777/raw/$(cat bla | jq -r .key) | grep "Hello World"')
24 '';
25}