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