From 5854407ab4aba08fdae5c4e74ad12fb98090be10 Mon Sep 17 00:00:00 2001 From: sefidel Date: Sat, 3 Feb 2024 04:10:59 +0900 Subject: feat(modules): add nitter --- modules/services/nitter/default.nix | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 modules/services/nitter/default.nix (limited to 'modules/services/nitter/default.nix') diff --git a/modules/services/nitter/default.nix b/modules/services/nitter/default.nix new file mode 100644 index 0000000..40e8be8 --- /dev/null +++ b/modules/services/nitter/default.nix @@ -0,0 +1,39 @@ +{ config, lib, pkgs, ... }: + +with lib; +let + cfg = config.modules.services.nitter; +in +{ + options.modules.services.nitter = { + enable = mkEnableOption "nitter instance"; + + title = mkOption { type = types.str; default = "Nitter"; description = "Title of the nitter instance"; }; + + domain = mkOption { type = types.str; }; + realHost = mkOption { type = types.str; default = "nitter.${cfg.domain}"; }; + secrets = { + nitter-guest-accounts = mkOption { type = types.path; description = "path to the JSONL file containing guest accounts"; }; + }; + }; + + config = mkIf cfg.enable { + services.nitter = { + enable = true; + + package = pkgs.nitter.overrideAttrs { + patches = [ + ./0001-HACK-allow-non-guest-account.patch + ]; + }; + + server = { + title = cfg.title; + address = "127.0.0.1"; + port = 4002; + hostname = cfg.realHost; + }; + guestAccounts = cfg.secrets.nitter-guest-accounts; + }; + }; +} -- cgit 1.4.1