From 9b5f2fec893ad8769680d3a77dec83c3a14c4bdf Mon Sep 17 00:00:00 2001 From: uku Date: Tue, 25 Mar 2025 10:21:44 +0100 Subject: [PATCH 1/2] nitter: 0-unstable-2024-02-26 -> 0-unstable-2025-02-25 Guest account support was merged into the main branch, therefore the updater and source now follow the main branch. --- pkgs/by-name/ni/nitter/lock.json | 10 +++++----- pkgs/by-name/ni/nitter/package.nix | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pkgs/by-name/ni/nitter/lock.json b/pkgs/by-name/ni/nitter/lock.json index 2a9106dc9ff42..6d33994b513b6 100644 --- a/pkgs/by-name/ni/nitter/lock.json +++ b/pkgs/by-name/ni/nitter/lock.json @@ -16,12 +16,12 @@ "packages": [ "dotenv" ], - "path": "/nix/store/9hxi0hvds11agbmpaha8zp1bgzf7vypv-source", - "ref": "2.0.1", - "rev": "48315332fe79ffce87c81b9d0bec992ba19b6966", - "sha256": "08y8xvpiqk75v0hxhgbhxfbxz7l95vavh1lv8kxkid8rb9p92zr4", + "path": "/nix/store/jkf2p6sp0506crd1awpq2x98m527v4mb-source", + "ref": "2.0.2", + "rev": "19bb965ef04f57128f4f4ea2e690ff9f7d6a81b1", + "sha256": "0dk0ixgpxmaz2kf12a3fvzdaknn38qnwgdhp7yag0m5fbhhz2kjc", "srcDir": "src", - "url": "https://github.com/euantorano/dotenv.nim/archive/48315332fe79ffce87c81b9d0bec992ba19b6966.tar.gz" + "url": "https://github.com/euantorano/dotenv.nim/archive/19bb965ef04f57128f4f4ea2e690ff9f7d6a81b1.tar.gz" }, { "method": "fetchzip", diff --git a/pkgs/by-name/ni/nitter/package.nix b/pkgs/by-name/ni/nitter/package.nix index d03f1e0064137..6865383baa780 100644 --- a/pkgs/by-name/ni/nitter/package.nix +++ b/pkgs/by-name/ni/nitter/package.nix @@ -10,13 +10,13 @@ buildNimPackage ( finalAttrs: prevAttrs: { pname = "nitter"; - version = "0-unstable-2024-02-26"; + version = "0-unstable-2025-02-25"; src = fetchFromGitHub { owner = "zedeus"; repo = "nitter"; - rev = "c6edec04901d0a37799499ed4c6921db640fb5a4"; - hash = "sha256-N3d63nyVzUTa2+UemA1REFfVsw6iOVU8xUlYraR55m4="; + rev = "41fa47bfbf3917e9b3ac4f7b49c89a75a7a2bd44"; + hash = "sha256-cmYlmzCJl1405TuYExGw3AOmjdY0r7ObmmLCAom+Fyw="; }; lockFile = ./lock.json; @@ -41,7 +41,7 @@ buildNimPackage ( passthru = { tests = { inherit (nixosTests) nitter; }; - updateScript = unstableGitUpdater { branch = "guest_accounts"; }; + updateScript = unstableGitUpdater { }; }; meta = with lib; { From b6ba4a499c5ecdbacefbbfb265427e059ed15323 Mon Sep 17 00:00:00 2001 From: uku Date: Tue, 25 Mar 2025 10:26:55 +0100 Subject: [PATCH 2/2] nixos/nitter: rename guestAccounts to sessionsFile for consistency with upstream, see https://github.com/zedeus/nitter/commit/6fcd849eff51ad1ee6e6078e3236896ab97803b6 --- .../manual/release-notes/rl-2505.section.md | 2 ++ nixos/modules/services/misc/nitter.nix | 20 +++++++++++-------- nixos/tests/nitter.nix | 4 ++-- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/nixos/doc/manual/release-notes/rl-2505.section.md b/nixos/doc/manual/release-notes/rl-2505.section.md index 269b308fc3f81..40d417a3b07b0 100644 --- a/nixos/doc/manual/release-notes/rl-2505.section.md +++ b/nixos/doc/manual/release-notes/rl-2505.section.md @@ -462,6 +462,8 @@ - `nodePackages.ganache` has been removed, as the package has been deprecated by upstream. +- `services.nitter.guestAccounts` has been renamed to `services.nitter.sessionsFile`, for consistency with upstream. The file format is unchanged. + - `virtualisation.azure.agent` option provided by `azure-agent.nix` is replaced by `services.waagent`, and will be removed in a future release. - `matomo` now defaults to version 5 (previously available as `matomo_5`). Version 4 has been removed as it reached EOL on December 19, 2024. diff --git a/nixos/modules/services/misc/nitter.nix b/nixos/modules/services/misc/nitter.nix index 39aa069936f16..48ccc617b010c 100644 --- a/nixos/modules/services/misc/nitter.nix +++ b/nixos/modules/services/misc/nitter.nix @@ -64,6 +64,10 @@ in "nitter" "replaceInstagram" ] "Nitter no longer supports this option as Bibliogram has been discontinued.") + (lib.mkRenamedOptionModule + [ "services" "nitter" "guestAccounts" ] + [ "services" "nitter" "sessionsFile" ] + ) ]; options = { @@ -322,20 +326,20 @@ in ''; }; - guestAccounts = lib.mkOption { + sessionsFile = lib.mkOption { type = lib.types.path; - default = "/var/lib/nitter/guest_accounts.jsonl"; + default = "/var/lib/nitter/sessions.jsonl"; description = '' - Path to the guest accounts file. + Path to the session tokens file. - This file contains a list of guest accounts that can be used to + This file contains a list of session tokens that can be used to access the instance without logging in. The file is in JSONL format, where each line is a JSON object with the following fields: {"oauth_token":"some_token","oauth_token_secret":"some_secret_key"} - See - for more information on guest accounts and how to generate them. + See + for more information on session tokens and how to generate them. ''; }; @@ -369,11 +373,11 @@ in after = [ "network-online.target" ]; serviceConfig = { DynamicUser = true; - LoadCredential = "guestAccountsFile:${cfg.guestAccounts}"; + LoadCredential = "sessionsFile:${cfg.sessionsFile}"; StateDirectory = "nitter"; Environment = [ "NITTER_CONF_FILE=/var/lib/nitter/nitter.conf" - "NITTER_ACCOUNTS_FILE=%d/guestAccountsFile" + "NITTER_SESSIONS_FILE=%d/sessionsFile" ]; # Some parts of Nitter expect `public` folder in working directory, # see https://github.com/zedeus/nitter/issues/414 diff --git a/nixos/tests/nitter.nix b/nixos/tests/nitter.nix index 22466ec53a098..3b063c9f19ae6 100644 --- a/nixos/tests/nitter.nix +++ b/nixos/tests/nitter.nix @@ -8,7 +8,7 @@ import ./make-test-python.nix ( # 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" '' + sessionsFile = pkgs.writeText "sessions.jsonl" '' {"oauth_token":"1719213587296620928-BsXY2RIJEw7fjxoNwbBemgjJhueK0m","oauth_token_secret":"N0WB0xhL4ng6WTN44aZO82SUJjz7ssI3hHez2CUhTiYqy"} ''; in @@ -22,7 +22,7 @@ import ./make-test-python.nix ( # Test CAP_NET_BIND_SERVICE server.port = 80; # Provide dummy guest accounts - guestAccounts = guestAccountFile; + inherit sessionsFile; }; };