]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - pkgs/webapps/ttrss/default.nix
Move ttrss to pkgs
[perso/Immae/Config/Nix.git] / pkgs / webapps / ttrss / default.nix
1 { ttrss_config ? "/etc/ttrss/config.php"
2 , varDir ? "/var/lib/ttrss"
3 , stdenv, mylibs }:
4 let
5 withPlugins = plugins: package.overrideAttrs(old: rec {
6 name = "${old.name}-with-plugins";
7 installPhase = old.installPhase +
8 builtins.concatStringsSep "\n" (
9 map (value: "ln -s ${value} $out/plugins/${value.pluginName}") plugins
10 );
11 passthru = old.passthru // {
12 inherit plugins;
13 withPlugins = morePlugins: old.withPlugins (morePlugins ++ plugins);
14 };
15 });
16 package = stdenv.mkDerivation (mylibs.fetchedGit ./tt-rss.json // rec {
17 buildPhase = ''
18 rm -rf lock feed-icons cache
19 ln -sf ${varDir}/{lock,feed-icons,cache} .
20 '';
21 installPhase = ''
22 cp -a . $out
23 ln -s ${ttrss_config} $out/config.php
24 '';
25 passthru = {
26 plugins = [];
27 inherit withPlugins;
28 };
29 });
30 in package