5 testUser = "testerman";
7 testEmail = "test.testerman@test.com";
11 meta.maintainers = with lib.maintainers; [ devusb ];
16 environment.systemPackages = [
25 services.postgresql.enable = true;
32 openRegistration = true;
36 client = { ... }: { };
46 # wait for atuin server startup
47 server.wait_for_unit("atuin.service")
48 server.wait_for_open_port(${toString testPort})
50 # configure atuin client on server node
51 server.execute("mkdir -p ~/.config/atuin")
52 server.execute("echo 'sync_address = \"http://localhost:${toString testPort}\"' > ~/.config/atuin/config.toml")
54 # register with atuin server on server node
55 server.succeed("atuin register -u ${testUser} -p ${testPass} -e ${testEmail}")
56 _, key = server.execute("atuin key")
58 # store test record in atuin server and sync
59 server.succeed("ATUIN_SESSION=$(atuin uuid) atuin history start 'shazbot'")
60 server.succeed("ATUIN_SESSION=$(atuin uuid) atuin sync")
62 # configure atuin client on client node
63 client.execute("mkdir -p ~/.config/atuin")
64 client.execute("echo 'sync_address = \"http://server:${toString testPort}\"' > ~/.config/atuin/config.toml")
66 # log in to atuin server on client node
67 client.succeed(f"atuin login -u ${testUser} -p ${testPass} -k \"{key}\"")
69 # pull records from atuin server
70 client.succeed("atuin sync -f")
72 # check for test record
73 client.succeed("ATUIN_SESSION=$(atuin uuid) atuin history list | grep shazbot")