1{ pkgs, lib, ... }:
2
3let
4 port = 1234;
5in
6{
7 name = "mollysocket";
8 meta.maintainers = with lib.maintainers; [ dotlambda ];
9
10 nodes.mollysocket =
11 { ... }:
12 {
13 services.mollysocket = {
14 enable = true;
15 settings = {
16 inherit port;
17 };
18 };
19 };
20
21 testScript = ''
22 mollysocket.wait_for_unit("mollysocket.service")
23 mollysocket.wait_for_open_port(${toString port})
24
25 out = mollysocket.succeed("curl --fail http://127.0.0.1:${toString port}")
26 assert "Version ${pkgs.mollysocket.version}" in out
27 '';
28}