summaryrefslogtreecommitdiff
path: root/pkgs/webapps/ttrss/default.nix
blob: 0ce2f94fd5c78ce400b502402e38feb6592065b3 (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
{ ttrss_config ? "/etc/ttrss/config.php"
, varDir ? "/var/lib/ttrss"
, stdenv, mylibs }:
let
  withPlugins = plugins: package.overrideAttrs(old: rec {
    name = "${old.name}-with-plugins";
    installPhase = old.installPhase +
      builtins.concatStringsSep "\n" (
        map (value: "ln -s ${value} $out/plugins/${value.pluginName}") plugins
      );
    passthru = old.passthru // {
      inherit plugins;
      withPlugins = morePlugins: old.withPlugins (morePlugins ++ plugins);
    };
  });
  package = stdenv.mkDerivation (mylibs.fetchedGit ./tt-rss.json // rec {
    buildPhase = ''
      rm -rf lock feed-icons cache
      ln -sf ${varDir}/{lock,feed-icons,cache} .
      '';
      installPhase = ''
        cp -a . $out
        ln -s ${ttrss_config} $out/config.php
      '';
    passthru = {
      plugins = [];
      inherit withPlugins;
    };
  });
in package