From d5a1e9ce50c03796430068a2f90b3526d9e55bb6 Mon Sep 17 00:00:00 2001 From: "Jill \"oatmealine\" Monoids" Date: Fri, 23 Feb 2024 12:45:47 +0100 Subject: [PATCH] fix nitter ???!?? --- modules/services/nitter-age-check.patch | 13 +++++++++++++ modules/services/nitter.nix | 14 ++++++++++++-- overlays/nitter.nix | 12 ------------ 3 files changed, 25 insertions(+), 14 deletions(-) create mode 100644 modules/services/nitter-age-check.patch delete mode 100644 overlays/nitter.nix diff --git a/modules/services/nitter-age-check.patch b/modules/services/nitter-age-check.patch new file mode 100644 index 0000000..7778cd3 --- /dev/null +++ b/modules/services/nitter-age-check.patch @@ -0,0 +1,13 @@ +diff --git a/src/auth.nim b/src/auth.nim +index b288c50..de1b1d8 100644 +--- a/src/auth.nim ++++ b/src/auth.nim +@@ -202,7 +202,7 @@ proc initAccountPool*(cfg: Config; path: string) = + quit 1 + + let accountsPrePurge = accountPool.len +- accountPool.keepItIf(not it.hasExpired) ++ #accountPool.keepItIf(not it.hasExpired) + + log "Successfully added ", accountPool.len, " valid accounts." + if accountsPrePurge > accountPool.len: diff --git a/modules/services/nitter.nix b/modules/services/nitter.nix index 7f5aad1..2634bfc 100644 --- a/modules/services/nitter.nix +++ b/modules/services/nitter.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, options, ... }: +{ config, lib, pkgs, options, inputs, ... }: # heavily references https://github.com/erdnaxe/nixos-modules/blob/master/services/nitter.nix @@ -29,11 +29,21 @@ in { }; }; + # force unstable + disabledModules = [ "services/misc/nitter.nix" ]; + imports = [ + "${inputs.nixpkgs-unstable}/nixos/modules/services/misc/nitter.nix" + ]; + config = mkIf cfg.enable { services = { nitter = { enable = true; - package = pkgs.nitter; + package = pkgs.unstable.nitter.overrideAttrs (old: { + patches = old.patches ++ [ + ./nitter-age-check.patch + ]; + }); config = { proxy = ""; # https://github.com/NixOS/nixpkgs/issues/235359 }; diff --git a/overlays/nitter.nix b/overlays/nitter.nix deleted file mode 100644 index c192a67..0000000 --- a/overlays/nitter.nix +++ /dev/null @@ -1,12 +0,0 @@ -self: super: { - nitter = super.nitter.overrideAttrs (old: { - # https://github.com/zedeus/nitter/pull/830 - version = "unstable-2023-05-31"; - src = super.fetchFromGitHub { - owner = "zedeus"; - repo = "nitter"; - rev = "38985af6ed30f050201b15425cdac0dc2e286b6d"; - hash = "sha256-YPwApMCsra/T5EzCup28/4FaOrhEuw3MBiitv+LTbi0="; - }; - }); -}