1{ pkgs, ... }:
2
3let
4 # In a real deployment this should naturally not common from the nix store
5 # and be seeded via agenix or as a non-nix managed file.
6 #
7 # These credentials are from the nitter wiki and are expired. We must provide
8 # credentials in the correct format, otherwise nitter fails to start. They
9 # must not be valid, as unauthorized errors are handled gracefully.
10 sessionsFile = pkgs.writeText "sessions.jsonl" ''
11 {"oauth_token":"1719213587296620928-BsXY2RIJEw7fjxoNwbBemgjJhueK0m","oauth_token_secret":"N0WB0xhL4ng6WTN44aZO82SUJjz7ssI3hHez2CUhTiYqy"}
12 '';
13in
14{
15 name = "nitter";
16 meta.maintainers = with pkgs.lib.maintainers; [ erdnaxe ];
17
18 nodes.machine = {
19 services.nitter = {
20 enable = true;
21 # Test CAP_NET_BIND_SERVICE
22 server.port = 80;
23 # Provide dummy guest accounts
24 inherit sessionsFile;
25 };
26 };
27
28 testScript = ''
29 machine.wait_for_unit("nitter.service")
30 machine.wait_for_open_port(80)
31 machine.succeed("curl --fail http://localhost:80/")
32 '';
33}