about summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authorRaghav Sood <r@raghavsood.com>2023-12-21 14:03:35 +0800
committerGitHub <noreply@github.com>2023-12-21 14:03:35 +0800
commit7d97d9ebd1992cad1a91d6988198dcc9d9ecb21c (patch)
treea63772dacf99dd5ca4c777f81462644c1ba9549b /nixos/tests
parentd6863cbcbbb80e71cecfc03356db1cda38919523 (diff)
parentd380604c446487eaadd71284c7ceaec83eff4d8a (diff)
Merge pull request #275439 from RaghavSood/nitter/guest-accounts
nitter: unstable-2023-10-31 -> unstable-2023-12-03 (guest accounts support)
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/nitter.nix21
1 files changed, 18 insertions, 3 deletions
diff --git a/nixos/tests/nitter.nix b/nixos/tests/nitter.nix
index 8bc55ba8c69fc..114f1aac7c7af 100644
--- a/nixos/tests/nitter.nix
+++ b/nixos/tests/nitter.nix
@@ -1,13 +1,28 @@
 import ./make-test-python.nix ({ pkgs, ... }:
 
+let
+  # In a real deployment this should naturally not common from the nix store
+  # and be seeded via agenix or as a non-nix managed file.
+  #
+  # These credentials are from the nitter wiki and are expired. We must provide
+  # credentials in the correct format, otherwise nitter fails to start. They
+  # must not be valid, as unauthorized errors are handled gracefully.
+  guestAccountFile = pkgs.writeText "guest_accounts.jsonl" ''
+    {"oauth_token":"1719213587296620928-BsXY2RIJEw7fjxoNwbBemgjJhueK0m","oauth_token_secret":"N0WB0xhL4ng6WTN44aZO82SUJjz7ssI3hHez2CUhTiYqy"}
+  '';
+in
 {
   name = "nitter";
   meta.maintainers = with pkgs.lib.maintainers; [ erdnaxe ];
 
   nodes.machine = {
-    services.nitter.enable = true;
-    # Test CAP_NET_BIND_SERVICE
-    services.nitter.server.port = 80;
+    services.nitter = {
+      enable = true;
+      # Test CAP_NET_BIND_SERVICE
+      server.port = 80;
+      # Provide dummy guest accounts
+      guestAccounts = guestAccountFile;
+    };
   };
 
   testScript = ''