1{ lib, ... }:
2{
3 name = "gotosocial";
4 meta.maintainers = with lib.maintainers; [ misuzu ];
5
6 nodes.machine = { pkgs, ... }: {
7 environment.systemPackages = [ pkgs.jq ];
8 services.gotosocial = {
9 enable = true;
10 setupPostgresqlDB = true;
11 settings = {
12 host = "localhost:8081";
13 port = 8081;
14 };
15 };
16 };
17
18 testScript = ''
19 machine.wait_for_unit("gotosocial.service")
20 machine.wait_for_unit("postgresql.service")
21 machine.wait_for_open_port(8081)
22
23 # check user registration via cli
24 machine.succeed("curl -sS -f http://localhost:8081/nodeinfo/2.0 | jq '.usage.users.total' | grep -q '^0$'")
25 machine.succeed("gotosocial-admin account create --username nickname --email email@example.com --password kurtz575VPeBgjVm")
26 machine.succeed("curl -sS -f http://localhost:8081/nodeinfo/2.0 | jq '.usage.users.total' | grep -q '^1$'")
27 '';
28}