From 86663f1789aecdb62e44a4be46e0ed111b795a09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Tue, 7 May 2019 15:02:33 +0200 Subject: Move ttrss to pkgs --- pkgs/webapps/default.nix | 13 ++++++++++ pkgs/webapps/ttrss/default.nix | 30 ++++++++++++++++++++++ .../ttrss/plugins/af_feedmod/af_feedmod.json | 15 +++++++++++ pkgs/webapps/ttrss/plugins/af_feedmod/default.nix | 9 +++++++ .../ttrss/plugins/af_feedmod/type_replace.patch | 12 +++++++++ .../webapps/ttrss/plugins/auth_ldap/auth-ldap.json | 15 +++++++++++ pkgs/webapps/ttrss/plugins/auth_ldap/default.nix | 8 ++++++ pkgs/webapps/ttrss/plugins/feediron/default.nix | 9 +++++++ pkgs/webapps/ttrss/plugins/feediron/feediron.json | 15 +++++++++++ .../ttrss/plugins/feediron/json_reformat.patch | 18 +++++++++++++ .../webapps/ttrss/plugins/ff_instagram/default.nix | 8 ++++++ .../ttrss/plugins/ff_instagram/ff_instagram.json | 15 +++++++++++ .../ttrss/plugins/tumblr_gdpr_ua/default.nix | 8 ++++++ .../plugins/tumblr_gdpr_ua/tumblr_gdpr_ua.json | 15 +++++++++++ pkgs/webapps/ttrss/tt-rss.json | 14 ++++++++++ 15 files changed, 204 insertions(+) create mode 100644 pkgs/webapps/ttrss/default.nix create mode 100644 pkgs/webapps/ttrss/plugins/af_feedmod/af_feedmod.json create mode 100644 pkgs/webapps/ttrss/plugins/af_feedmod/default.nix create mode 100644 pkgs/webapps/ttrss/plugins/af_feedmod/type_replace.patch create mode 100644 pkgs/webapps/ttrss/plugins/auth_ldap/auth-ldap.json create mode 100644 pkgs/webapps/ttrss/plugins/auth_ldap/default.nix create mode 100644 pkgs/webapps/ttrss/plugins/feediron/default.nix create mode 100644 pkgs/webapps/ttrss/plugins/feediron/feediron.json create mode 100644 pkgs/webapps/ttrss/plugins/feediron/json_reformat.patch create mode 100644 pkgs/webapps/ttrss/plugins/ff_instagram/default.nix create mode 100644 pkgs/webapps/ttrss/plugins/ff_instagram/ff_instagram.json create mode 100644 pkgs/webapps/ttrss/plugins/tumblr_gdpr_ua/default.nix create mode 100644 pkgs/webapps/ttrss/plugins/tumblr_gdpr_ua/tumblr_gdpr_ua.json create mode 100644 pkgs/webapps/ttrss/tt-rss.json (limited to 'pkgs/webapps') diff --git a/pkgs/webapps/default.nix b/pkgs/webapps/default.nix index 073905c..a4e4f87 100644 --- a/pkgs/webapps/default.nix +++ b/pkgs/webapps/default.nix @@ -67,6 +67,19 @@ rec { lib.attrsets.genAttrs names (name: callPackage (./roundcubemail/plugins + "/${name}") { buildPlugin = roundcubemail.buildPlugin; }); + ttrss = callPackage ./ttrss { inherit mylibs; }; + ttrss-with-plugins = ttrss.withPlugins (builtins.attrValues ttrss-plugins); + ttrss-plugins = let + names = [ "auth_ldap" "af_feedmod" "feediron" "ff_instagram" "tumblr_gdpr_ua" ]; + patched = [ "af_feedmod" "feediron" ]; + in + lib.attrsets.genAttrs names + (name: callPackage (./ttrss/plugins + "/${name}") ( + { inherit mylibs; } // + (if builtins.elem name patched then { patched = true; } else {}) + ) + ); + yourls = callPackage ./yourls { inherit mylibs; }; yourls-with-plugins = yourls.withPlugins (builtins.attrValues yourls-plugins); yourls-plugins = let diff --git a/pkgs/webapps/ttrss/default.nix b/pkgs/webapps/ttrss/default.nix new file mode 100644 index 0000000..0ce2f94 --- /dev/null +++ b/pkgs/webapps/ttrss/default.nix @@ -0,0 +1,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 diff --git a/pkgs/webapps/ttrss/plugins/af_feedmod/af_feedmod.json b/pkgs/webapps/ttrss/plugins/af_feedmod/af_feedmod.json new file mode 100644 index 0000000..e57fcce --- /dev/null +++ b/pkgs/webapps/ttrss/plugins/af_feedmod/af_feedmod.json @@ -0,0 +1,15 @@ +{ + "tag": "0ea2092-master", + "meta": { + "name": "ttrss-af_feedmod", + "url": "https://github.com/mbirth/ttrss_plugin-af_feedmod", + "branch": "master" + }, + "github": { + "owner": "mbirth", + "repo": "ttrss_plugin-af_feedmod", + "rev": "0ea2092dd34067ecd898802cfca3570023d1ecfe", + "sha256": "02ibf47zcrsc2rr45wsix8gxyyf371davj8n8i0gj1zdq95klvnv", + "fetchSubmodules": true + } +} diff --git a/pkgs/webapps/ttrss/plugins/af_feedmod/default.nix b/pkgs/webapps/ttrss/plugins/af_feedmod/default.nix new file mode 100644 index 0000000..8512be3 --- /dev/null +++ b/pkgs/webapps/ttrss/plugins/af_feedmod/default.nix @@ -0,0 +1,9 @@ +{ patched ? false, stdenv, mylibs, lib }: +stdenv.mkDerivation (mylibs.fetchedGithub ./af_feedmod.json // { + patches = lib.optionals patched [ ./type_replace.patch ]; + installPhase = '' + mkdir $out + cp init.php $out + ''; + passthru.pluginName = "af_feedmod"; +}) diff --git a/pkgs/webapps/ttrss/plugins/af_feedmod/type_replace.patch b/pkgs/webapps/ttrss/plugins/af_feedmod/type_replace.patch new file mode 100644 index 0000000..d622577 --- /dev/null +++ b/pkgs/webapps/ttrss/plugins/af_feedmod/type_replace.patch @@ -0,0 +1,12 @@ +--- a/init.php 2014-06-16 14:21:06.995480038 +0200 ++++ b/init.php 2014-06-16 14:22:00.151027654 +0200 +@@ -147,6 +147,9 @@ + } + } + break; ++ case 'replace': ++ $article['content'] = preg_replace("/".$config['pattern']."/",$config['replacement'],$article['content']); ++ break; + + default: + // unknown type or invalid config diff --git a/pkgs/webapps/ttrss/plugins/auth_ldap/auth-ldap.json b/pkgs/webapps/ttrss/plugins/auth_ldap/auth-ldap.json new file mode 100644 index 0000000..c8aaab5 --- /dev/null +++ b/pkgs/webapps/ttrss/plugins/auth_ldap/auth-ldap.json @@ -0,0 +1,15 @@ +{ + "tag": "4d751b0-master", + "meta": { + "name": "ttrss-auth-ldap", + "url": "https://github.com/hydrian/TTRSS-Auth-LDAP", + "branch": "master" + }, + "github": { + "owner": "hydrian", + "repo": "TTRSS-Auth-LDAP", + "rev": "4d751b095c29a8dbe2dc7bb07777742956136e94", + "sha256": "0b9fl86acrzpcv41r7pj3bl8b3n72hpkdywzx9zjyfqv5pskxyim", + "fetchSubmodules": true + } +} diff --git a/pkgs/webapps/ttrss/plugins/auth_ldap/default.nix b/pkgs/webapps/ttrss/plugins/auth_ldap/default.nix new file mode 100644 index 0000000..424a9f7 --- /dev/null +++ b/pkgs/webapps/ttrss/plugins/auth_ldap/default.nix @@ -0,0 +1,8 @@ +{ stdenv, mylibs }: +stdenv.mkDerivation (mylibs.fetchedGithub ./auth-ldap.json // { + installPhase = '' + mkdir $out + cp plugins/auth_ldap/init.php $out + ''; + passthru.pluginName = "auth_ldap"; +}) diff --git a/pkgs/webapps/ttrss/plugins/feediron/default.nix b/pkgs/webapps/ttrss/plugins/feediron/default.nix new file mode 100644 index 0000000..80bfda4 --- /dev/null +++ b/pkgs/webapps/ttrss/plugins/feediron/default.nix @@ -0,0 +1,9 @@ +{ patched ? false, stdenv, mylibs, lib }: +stdenv.mkDerivation (mylibs.fetchedGithub ./feediron.json // { + patches = lib.optionals patched [ ./json_reformat.patch ]; + installPhase = '' + mkdir $out + cp -a . $out + ''; + passthru.pluginName = "feediron"; +}) diff --git a/pkgs/webapps/ttrss/plugins/feediron/feediron.json b/pkgs/webapps/ttrss/plugins/feediron/feediron.json new file mode 100644 index 0000000..5dbec92 --- /dev/null +++ b/pkgs/webapps/ttrss/plugins/feediron/feediron.json @@ -0,0 +1,15 @@ +{ + "tag": "407168c-master", + "meta": { + "name": "ttrss-feediron", + "url": "https://github.com/m42e/ttrss_plugin-feediron", + "branch": "master" + }, + "github": { + "owner": "m42e", + "repo": "ttrss_plugin-feediron", + "rev": "407168c628880b5ced572cc549db6d50e866d3c8", + "sha256": "17b95ifpcph6m03hjd1mhi8gi1hw9yd3fnffmw66fqr5c9l3zd9r", + "fetchSubmodules": true + } +} diff --git a/pkgs/webapps/ttrss/plugins/feediron/json_reformat.patch b/pkgs/webapps/ttrss/plugins/feediron/json_reformat.patch new file mode 100644 index 0000000..e1c44d9 --- /dev/null +++ b/pkgs/webapps/ttrss/plugins/feediron/json_reformat.patch @@ -0,0 +1,18 @@ +diff --git a/init.php b/init.php +index 3c0f2f9..1aad146 100644 +--- a/init.php ++++ b/init.php +@@ -600,10 +600,11 @@ class Feediron extends Plugin implements IHandler + return false; + } + +- $this->host->set($this, 'json_conf', Feediron_Json::format($json_conf)); ++ $new_conf = json_encode(json_decode($json_conf), JSON_PRETTY_PRINT); ++ $this->host->set($this, 'json_conf', $new_conf); + $json_reply['success'] = true; + $json_reply['message'] = __('Configuration saved.'); +- $json_reply['json_conf'] = Feediron_Json::format($json_conf); ++ $json_reply['json_conf'] = $new_conf; + echo json_encode($json_reply); + } + diff --git a/pkgs/webapps/ttrss/plugins/ff_instagram/default.nix b/pkgs/webapps/ttrss/plugins/ff_instagram/default.nix new file mode 100644 index 0000000..3540f73 --- /dev/null +++ b/pkgs/webapps/ttrss/plugins/ff_instagram/default.nix @@ -0,0 +1,8 @@ +{ stdenv, mylibs }: +stdenv.mkDerivation (mylibs.fetchedGithub ./ff_instagram.json // { + installPhase = '' + mkdir $out + cp -a . $out + ''; + passthru.pluginName = "ff_instagram"; +}) diff --git a/pkgs/webapps/ttrss/plugins/ff_instagram/ff_instagram.json b/pkgs/webapps/ttrss/plugins/ff_instagram/ff_instagram.json new file mode 100644 index 0000000..1f241b9 --- /dev/null +++ b/pkgs/webapps/ttrss/plugins/ff_instagram/ff_instagram.json @@ -0,0 +1,15 @@ +{ + "tag": "0366ffb-master", + "meta": { + "name": "ttrss-ff_instagram", + "url": "https://github.com/wltb/ff_instagram", + "branch": "master" + }, + "github": { + "owner": "wltb", + "repo": "ff_instagram", + "rev": "0366ffb18c4d490c8fbfba2f5f3367a5af23cfe8", + "sha256": "0vvzl6wi6jmrqknsfddvckjgsgfizz1d923d1nyrpzjfn6bda1vk", + "fetchSubmodules": true + } +} diff --git a/pkgs/webapps/ttrss/plugins/tumblr_gdpr_ua/default.nix b/pkgs/webapps/ttrss/plugins/tumblr_gdpr_ua/default.nix new file mode 100644 index 0000000..2cf3e05 --- /dev/null +++ b/pkgs/webapps/ttrss/plugins/tumblr_gdpr_ua/default.nix @@ -0,0 +1,8 @@ +{ stdenv, mylibs }: +stdenv.mkDerivation (mylibs.fetchedGithub ./tumblr_gdpr_ua.json // { + installPhase = '' + mkdir $out + cp -a . $out + ''; + passthru.pluginName = "tumblr_gdpr_ua"; +}) diff --git a/pkgs/webapps/ttrss/plugins/tumblr_gdpr_ua/tumblr_gdpr_ua.json b/pkgs/webapps/ttrss/plugins/tumblr_gdpr_ua/tumblr_gdpr_ua.json new file mode 100644 index 0000000..eafbcfe --- /dev/null +++ b/pkgs/webapps/ttrss/plugins/tumblr_gdpr_ua/tumblr_gdpr_ua.json @@ -0,0 +1,15 @@ +{ + "tag": "287c584-master", + "meta": { + "name": "ttrss-tumblr_gdpr_ua", + "url": "https://github.com/hkockerbeck/ttrss-tumblr-gdpr-ua", + "branch": "master" + }, + "github": { + "owner": "hkockerbeck", + "repo": "ttrss-tumblr-gdpr-ua", + "rev": "287c584e68845d524f920156bff0b2eaa6f65117", + "sha256": "1fviawgcclqky4k4xv1sqzvpb8i74w9f0pclm09m78s8l85wh9py", + "fetchSubmodules": true + } +} diff --git a/pkgs/webapps/ttrss/tt-rss.json b/pkgs/webapps/ttrss/tt-rss.json new file mode 100644 index 0000000..e2731b0 --- /dev/null +++ b/pkgs/webapps/ttrss/tt-rss.json @@ -0,0 +1,14 @@ +{ + "tag": "986ca25-master", + "meta": { + "name": "tt-rss", + "url": "https://git.tt-rss.org/fox/tt-rss.git", + "branch": "master" + }, + "git": { + "url": "https://git.tt-rss.org/fox/tt-rss.git", + "rev": "986ca251f995f7754a0470d3e0c44538a545081f", + "sha256": "0xkafkh7l9zazm5d6snlq03kdfxfhkb4c8fdsb32wn8b9bhdzf5s", + "fetchSubmodules": true + } +} -- cgit v1.2.3