about summary refs log tree commit diff
path: root/pkgs/servers/web-apps/freshrss/extensions/default.nix
blob: c8d779f7933d629b1ae9491ad35a31a0fca84e09 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
{ config
, lib
, fetchFromGitHub
, fetchFromGitLab
, callPackage
}:

let
  buildFreshRssExtension = (callPackage ./freshrss-utils.nix { }).buildFreshRssExtension;

  official_extensions_version = "unstable-2024-04-27";
  official_extensions_src = fetchFromGitHub {
    owner = "FreshRSS";
    repo = "Extensions";
    rev = "71de129744ba37fd4cf363b78445f5345bc6d0b7";
    hash = "sha256-A+hOjbGNfhwTOAMeo08MUdqfWxxetzLz865oQQDsQlg=";
  };

  baseExtensions =
    _self:
    lib.mapAttrs (_n: lib.recurseIntoAttrs) {
      auto-ttl = buildFreshRssExtension rec {
        FreshRssExtUniqueId = "AutoTTL";
        pname = "auto-ttl";
        version = "0.5.0";
        src = fetchFromGitHub {
          owner = "mgnsk";
          repo = "FreshRSS-AutoTTL";
          rev = "v${version}";
          hash = "sha256-OiTiLZ2BjQD1W/BD8EkUt7WB2wOjL6GMGJ+APT4YpwE=";
        };
        meta = {
          description = "FreshRSS extension for automatic feed refresh TTL based on the average frequency of entries.";
          homepage = "https://github.com/mgnsk/FreshRSS-AutoTTL";
          license = lib.licenses.agpl3Only;
          maintainers = [ lib.maintainers.stunkymonkey ];
        };
      };

      demo = buildFreshRssExtension {
        FreshRssExtUniqueId = "Demo";
        pname = "demo";
        version = "unstable-2023-12-22";
        src = fetchFromGitHub {
          owner = "FreshRSS";
          repo = "xExtension-Demo";
          rev = "8d60f71a2f0411f5fbbb1f88a57791cee0848f35";
          hash = "sha256-5fe8TjefSiGMaeZkurxSJjX8qEEa1ArhJxDztp7ZNZc=";
        };
        meta = {
          description = "FreshRSS Extension for the demo version.";
          homepage = "https://github.com/FreshRSS/xExtension-Demo";
          license = lib.licenses.agpl3Only;
          maintainers = [ lib.maintainers.stunkymonkey ];
        };
      };

      reading-time = buildFreshRssExtension rec {
        FreshRssExtUniqueId = "ReadingTime";
        pname = "reading-time";
        version = "1.5";
        src = fetchFromGitLab {
          domain = "framagit.org";
          owner = "Lapineige";
          repo = "FreshRSS_Extension-ReadingTime";
          rev = "fb6e9e944ef6c5299fa56ffddbe04c41e5a34ebf";
          hash = "sha256-C5cRfaphx4Qz2xg2z+v5qRji8WVSIpvzMbethTdSqsk=";
        };
        meta = {
          description = "FreshRSS extension adding a reading time estimation next to each article.";
          homepage = "https://framagit.org/Lapineige/FreshRSS_Extension-ReadingTime";
          license = lib.licenses.agpl3Only;
          maintainers = [ lib.maintainers.stunkymonkey ];
        };
      };

      reddit-image = buildFreshRssExtension rec {
        FreshRssExtUniqueId = "RedditImage";
        pname = "reddit-image";
        version = "1.2.0";
        src = fetchFromGitHub {
          owner = "aledeg";
          repo = "xExtension-RedditImage";
          rev = "v${version}";
          hash = "sha256-H/uxt441ygLL0RoUdtTn9Q6Q/Ois8RHlhF8eLpTza4Q=";
        };
        meta = {
          description = "FreshRSS extension to process Reddit feeds.";
          homepage = "https://github.com/aledeg/xExtension-RedditImage";
          license = lib.licenses.agpl3Only;
          maintainers = [ lib.maintainers.stunkymonkey ];
        };
      };

      title-wrap = buildFreshRssExtension {
        FreshRssExtUniqueId = "TitleWrap";
        pname = "title-wrap";
        version = official_extensions_version;
        src = official_extensions_src;
        sourceRoot = "source/xExtension-TitleWrap";
        meta = {
          description = "FreshRSS extension instead of truncating the title is wrapped.";
          homepage = "https://github.com/FreshRSS/Extensions/tree/master/xExtension-TitleWrap";
          license = lib.licenses.agpl3Only;
          maintainers = [ lib.maintainers.stunkymonkey ];
        };
      };

      youtube = buildFreshRssExtension {
        FreshRssExtUniqueId = "YouTube";
        pname = "youtube";
        version = official_extensions_version;
        src = official_extensions_src;
        sourceRoot = "source/xExtension-YouTube";
        meta = {
          description = "FreshRSS extension allows you to directly watch YouTube/PeerTube videos from within subscribed channel feeds.";
          homepage = "https://github.com/FreshRSS/Extensions/tree/master/xExtension-YouTube";
          license = lib.licenses.agpl3Only;
          maintainers = [ lib.maintainers.stunkymonkey ];
        };
      };
    };

  # add possibility to define aliases
  aliases = super: {
    # example:  RedditImage = super.reddit-image;
  };

  # overlays will be applied left to right, overrides should come after aliases.
  overlays = lib.optionals config.allowAliases [
    (_self: super: lib.recursiveUpdate super (aliases super))
  ];

  toFix = lib.foldl' (lib.flip lib.extends) baseExtensions overlays;
in
(lib.fix toFix) // {
  inherit buildFreshRssExtension;
}