diff options
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/webapps/default.nix | 67 | ||||
-rw-r--r-- | pkgs/webapps/dokuwiki/default.nix | 42 | ||||
-rw-r--r-- | pkgs/webapps/mantisbt_2/default.nix | 42 | ||||
-rw-r--r-- | pkgs/webapps/mediagoblin/default.nix | 35 | ||||
-rw-r--r-- | pkgs/webapps/roundcubemail/default.nix | 55 | ||||
-rw-r--r-- | pkgs/webapps/ttrss/default.nix | 45 | ||||
-rw-r--r-- | pkgs/webapps/yourls/default.nix | 34 |
7 files changed, 140 insertions, 180 deletions
diff --git a/pkgs/webapps/default.nix b/pkgs/webapps/default.nix index e3ec07f..33fd730 100644 --- a/pkgs/webapps/default.nix +++ b/pkgs/webapps/default.nix | |||
@@ -1,92 +1,27 @@ | |||
1 | { callPackage, mylibs, composerEnv, lib }: | 1 | { callPackage, mylibs, composerEnv }: |
2 | rec { | 2 | rec { |
3 | adminer = callPackage ./adminer {}; | 3 | adminer = callPackage ./adminer {}; |
4 | apache-theme = callPackage ./apache-theme {}; | 4 | apache-theme = callPackage ./apache-theme {}; |
5 | awl = callPackage ./awl {}; | 5 | awl = callPackage ./awl {}; |
6 | davical = callPackage ./davical {}; | 6 | davical = callPackage ./davical {}; |
7 | diaspora = callPackage ./diaspora { inherit mylibs; }; | 7 | diaspora = callPackage ./diaspora { inherit mylibs; }; |
8 | |||
9 | dokuwiki = callPackage ./dokuwiki { inherit mylibs; }; | 8 | dokuwiki = callPackage ./dokuwiki { inherit mylibs; }; |
10 | dokuwiki-with-plugins = dokuwiki.withPlugins (builtins.attrValues dokuwiki-plugins); | ||
11 | dokuwiki-plugins = let | ||
12 | names = [ "farmer" "todo" ]; | ||
13 | in | ||
14 | lib.attrsets.genAttrs names | ||
15 | (name: callPackage (./dokuwiki/plugins + "/${name}.nix") {}); | ||
16 | |||
17 | etherpad-lite = callPackage ./etherpad-lite {}; | 9 | etherpad-lite = callPackage ./etherpad-lite {}; |
18 | |||
19 | grocy = callPackage ./grocy { inherit mylibs composerEnv; }; | 10 | grocy = callPackage ./grocy { inherit mylibs composerEnv; }; |
20 | |||
21 | infcloud = callPackage ./infcloud {}; | 11 | infcloud = callPackage ./infcloud {}; |
22 | |||
23 | mantisbt_2 = callPackage ./mantisbt_2 {}; | 12 | mantisbt_2 = callPackage ./mantisbt_2 {}; |
24 | mantisbt_2-with-plugins = mantisbt_2.withPlugins (builtins.attrValues mantisbt_2-plugins); | ||
25 | mantisbt_2-plugins = let | ||
26 | names = [ "slack" "source-integration" ]; | ||
27 | in | ||
28 | lib.attrsets.genAttrs names | ||
29 | (name: callPackage (./mantisbt_2/plugins + "/${name}") {}); | ||
30 | |||
31 | mastodon = callPackage ./mastodon { inherit mylibs; }; | 13 | mastodon = callPackage ./mastodon { inherit mylibs; }; |
32 | |||
33 | mediagoblin = callPackage ./mediagoblin { inherit mylibs; }; | 14 | mediagoblin = callPackage ./mediagoblin { inherit mylibs; }; |
34 | mediagoblin-with-plugins = mediagoblin.withPlugins (builtins.attrValues mediagoblin-plugins); | ||
35 | mediagoblin-plugins = let | ||
36 | names = [ "basicsearch" ]; | ||
37 | in | ||
38 | lib.attrsets.genAttrs names | ||
39 | (name: callPackage (./mediagoblin/plugins + "/${name}") {}); | ||
40 | |||
41 | nextcloud = callPackage ./nextcloud {}; | 15 | nextcloud = callPackage ./nextcloud {}; |
42 | |||
43 | peertube = callPackage ./peertube { inherit mylibs; }; | 16 | peertube = callPackage ./peertube { inherit mylibs; }; |
44 | phpbb = callPackage ./phpbb {}; | 17 | phpbb = callPackage ./phpbb {}; |
45 | |||
46 | phpldapadmin = callPackage ./phpldapadmin {}; | 18 | phpldapadmin = callPackage ./phpldapadmin {}; |
47 | rompr = callPackage ./rompr { inherit mylibs; }; | 19 | rompr = callPackage ./rompr { inherit mylibs; }; |
48 | |||
49 | roundcubemail = callPackage ./roundcubemail {}; | 20 | roundcubemail = callPackage ./roundcubemail {}; |
50 | roundcubemail-with-plugins-skins = roundcubemail.withPlugins (builtins.attrValues roundcubemail-plugins) (builtins.attrValues roundcubemail-skins); | ||
51 | roundcubemail-skins = let | ||
52 | names = []; | ||
53 | in | ||
54 | lib.attrsets.genAttrs names | ||
55 | (name: callPackage (./roundcubemail/skins + "/${name}") {}); | ||
56 | roundcubemail-plugins = let | ||
57 | names = [ | ||
58 | "automatic_addressbook" "carddav" "contextmenu" | ||
59 | "contextmenu_folder" "html5_notifier" "ident_switch" | ||
60 | "message_highlight" "thunderbird_labels" | ||
61 | ]; | ||
62 | in | ||
63 | lib.attrsets.genAttrs names | ||
64 | (name: callPackage (./roundcubemail/plugins + "/${name}") { buildPlugin = roundcubemail.buildPlugin; }); | ||
65 | |||
66 | spip = callPackage ./spip {}; | 21 | spip = callPackage ./spip {}; |
67 | |||
68 | surfer = callPackage ./surfer { inherit mylibs; }; | 22 | surfer = callPackage ./surfer { inherit mylibs; }; |
69 | taskwarrior-web = callPackage ./taskwarrior-web { inherit mylibs; }; | 23 | taskwarrior-web = callPackage ./taskwarrior-web { inherit mylibs; }; |
70 | |||
71 | ttrss = callPackage ./ttrss { inherit mylibs; }; | 24 | ttrss = callPackage ./ttrss { inherit mylibs; }; |
72 | ttrss-with-plugins = ttrss.withPlugins (builtins.attrValues ttrss-plugins); | ||
73 | ttrss-plugins = let | ||
74 | names = [ "auth_ldap" "af_feedmod" "feediron" "ff_instagram" "tumblr_gdpr_ua" ]; | ||
75 | patched = [ "af_feedmod" "feediron" ]; | ||
76 | in | ||
77 | lib.attrsets.genAttrs names | ||
78 | (name: callPackage (./ttrss/plugins + "/${name}") ( | ||
79 | { inherit mylibs; } // | ||
80 | (if builtins.elem name patched then { patched = true; } else {}) | ||
81 | ) | ||
82 | ); | ||
83 | |||
84 | wallabag = callPackage ./wallabag { inherit composerEnv; }; | 25 | wallabag = callPackage ./wallabag { inherit composerEnv; }; |
85 | yourls = callPackage ./yourls { inherit mylibs; }; | 26 | yourls = callPackage ./yourls { inherit mylibs; }; |
86 | yourls-with-plugins = yourls.withPlugins (builtins.attrValues yourls-plugins); | ||
87 | yourls-plugins = let | ||
88 | names = [ "ldap" ]; | ||
89 | in | ||
90 | lib.attrsets.genAttrs names | ||
91 | (name: callPackage (./yourls/plugins + "/${name}") { inherit mylibs; }); | ||
92 | } | 27 | } |
diff --git a/pkgs/webapps/dokuwiki/default.nix b/pkgs/webapps/dokuwiki/default.nix index 9df88c6..874f0d8 100644 --- a/pkgs/webapps/dokuwiki/default.nix +++ b/pkgs/webapps/dokuwiki/default.nix | |||
@@ -1,4 +1,4 @@ | |||
1 | { varDir ? "/var/lib/dokuwiki", preload ? "", lib, stdenv, mylibs, writeText }: | 1 | { varDir ? "/var/lib/dokuwiki", preload ? "", lib, callPackage, stdenv, mylibs, writeText }: |
2 | let | 2 | let |
3 | preloadFile = plugins: let preloads = [preload] | 3 | preloadFile = plugins: let preloads = [preload] |
4 | ++ builtins.concatMap (p: lib.optional (lib.hasAttr "preload" p) (p.preload p)) plugins; | 4 | ++ builtins.concatMap (p: lib.optional (lib.hasAttr "preload" p) (p.preload p)) plugins; |
@@ -6,21 +6,26 @@ let | |||
6 | <?php | 6 | <?php |
7 | '' + builtins.concatStringsSep "\n" preloads | 7 | '' + builtins.concatStringsSep "\n" preloads |
8 | ); | 8 | ); |
9 | withPlugins = plugins: package.overrideAttrs(old: { | 9 | pluginNames = [ "farmer" "todo" ]; |
10 | name = "${old.name}-with-plugins"; | 10 | allPlugins = lib.attrsets.genAttrs pluginNames |
11 | installPhase = old.installPhase + ( | 11 | (name: callPackage (./plugins + "/${name}.nix") {}); |
12 | builtins.concatStringsSep "\n" ( | 12 | toPassthru = pkg: plugins: { |
13 | map (value: "ln -sf ${value} $out/lib/plugins/${value.pluginName}") plugins | 13 | inherit plugins varDir allPlugins; |
14 | ) | 14 | withPlugins = withPlugins pkg; |
15 | ); | 15 | }; |
16 | installPreloadPhase = '' | 16 | withPlugins = pkg: toPlugins: |
17 | cp ${preloadFile plugins} $out/inc/preload.php | 17 | let |
18 | ''; | 18 | plugins = toPlugins allPlugins; |
19 | passthru = old.passthru // { | 19 | toInstallPlugin = n: |
20 | inherit plugins; | 20 | "ln -sf ${n} $out/lib/plugins/${n.pluginName}"; |
21 | withPlugins = morePlugins: old.withPlugins (morePlugins ++ plugins); | 21 | newDokuwiki = pkg.overrideAttrs(old: { |
22 | }; | 22 | installPhase = old.installPhase + "\n" + builtins.concatStringsSep "\n" (map toInstallPlugin plugins); |
23 | }); | 23 | installPreloadPhase = '' |
24 | cp ${preloadFile (pkg.plugins ++ plugins)} $out/inc/preload.php | ||
25 | ''; | ||
26 | passthru = toPassthru newDokuwiki (pkg.plugins ++ plugins); | ||
27 | }); | ||
28 | in newDokuwiki; | ||
24 | package = stdenv.mkDerivation (mylibs.fetchedGithub ./dokuwiki.json // rec { | 29 | package = stdenv.mkDerivation (mylibs.fetchedGithub ./dokuwiki.json // rec { |
25 | phases = "unpackPhase buildPhase installPhase installPreloadPhase fixupPhase"; | 30 | phases = "unpackPhase buildPhase installPhase installPreloadPhase fixupPhase"; |
26 | buildPhase = '' | 31 | buildPhase = '' |
@@ -35,9 +40,6 @@ let | |||
35 | installPreloadPhase = '' | 40 | installPreloadPhase = '' |
36 | cp ${preloadFile []} $out/inc/preload.php | 41 | cp ${preloadFile []} $out/inc/preload.php |
37 | ''; | 42 | ''; |
38 | passthru = { | 43 | passthru = toPassthru package []; |
39 | plugins = []; | ||
40 | inherit withPlugins varDir; | ||
41 | }; | ||
42 | }); | 44 | }); |
43 | in package | 45 | in package |
diff --git a/pkgs/webapps/mantisbt_2/default.nix b/pkgs/webapps/mantisbt_2/default.nix index bb2aad3..5aa04d1 100644 --- a/pkgs/webapps/mantisbt_2/default.nix +++ b/pkgs/webapps/mantisbt_2/default.nix | |||
@@ -1,20 +1,25 @@ | |||
1 | { mantis_config ? "/etc/mantisbt/config_inc.php", stdenv, fetchurl }: | 1 | { mantis_config ? "/etc/mantisbt/config_inc.php", stdenv, fetchurl, lib, callPackage}: |
2 | let | 2 | let |
3 | withPlugins = plugins: package.overrideAttrs(old: { | 3 | pluginNames = [ "slack" "source-integration" ]; |
4 | name = "${old.name}-with-plugins"; | 4 | allPlugins = lib.attrsets.genAttrs pluginNames |
5 | installPhase = old.installPhase + ( | 5 | (name: callPackage (./plugins + "/${name}") {}); |
6 | builtins.concatStringsSep "\n" ( | 6 | toPassthru = pkg: plugins: { |
7 | map (value: if builtins.hasAttr "selector" value then | 7 | inherit plugins allPlugins; |
8 | "ln -sf ${value}/${value.selector} $out/plugins/" | 8 | withPlugins = withPlugins pkg; |
9 | else | 9 | }; |
10 | "ln -sf ${value} $out/plugins/${value.pluginName}" | 10 | withPlugins = pkg: toPlugins: |
11 | ) plugins | 11 | let |
12 | )); | 12 | plugins = toPlugins allPlugins; |
13 | passthru = old.passthru // { | 13 | toInstallPlugin = n: |
14 | inherit plugins; | 14 | if builtins.hasAttr "selector" n then |
15 | withPlugins = morePlugins: old.withPlugins (morePlugins ++ plugins); | 15 | "ln -sf ${n}/${n.selector} $out/plugins/" |
16 | }; | 16 | else |
17 | }); | 17 | "ln -sf ${n} $out/plugins/${n.pluginName}"; |
18 | newMantisbt = pkg.overrideAttrs(old: { | ||
19 | installPhase = old.installPhase + "\n" + builtins.concatStringsSep "\n" (map toInstallPlugin plugins); | ||
20 | passthru = toPassthru newMantisbt (pkg.plugins ++ plugins); | ||
21 | }); | ||
22 | in newMantisbt; | ||
18 | package = stdenv.mkDerivation rec { | 23 | package = stdenv.mkDerivation rec { |
19 | name = "mantisbt-${version}"; | 24 | name = "mantisbt-${version}"; |
20 | version = "2.21.0"; | 25 | version = "2.21.0"; |
@@ -33,9 +38,6 @@ let | |||
33 | ln -s ${mantis_config} $out/config/config_inc.php | 38 | ln -s ${mantis_config} $out/config/config_inc.php |
34 | ''; | 39 | ''; |
35 | 40 | ||
36 | passthru = { | 41 | passthru = toPassthru package []; |
37 | plugins = []; | ||
38 | inherit withPlugins; | ||
39 | }; | ||
40 | }; | 42 | }; |
41 | in package | 43 | in package |
diff --git a/pkgs/webapps/mediagoblin/default.nix b/pkgs/webapps/mediagoblin/default.nix index c20bcb4..d348ce1 100644 --- a/pkgs/webapps/mediagoblin/default.nix +++ b/pkgs/webapps/mediagoblin/default.nix | |||
@@ -1,4 +1,4 @@ | |||
1 | { makeWrapper, stdenv, writeScript, fetchurl, buildBowerComponents, mylibs, which, python36, gst_all_1, automake, autoconf, nodejs, nodePackages }: | 1 | { makeWrapper, stdenv, writeScript, fetchurl, buildBowerComponents, mylibs, which, python36, gst_all_1, automake, autoconf, nodejs, nodePackages, lib, callPackage }: |
2 | let | 2 | let |
3 | overridePython = let | 3 | overridePython = let |
4 | packageOverrides = self: super: { | 4 | packageOverrides = self: super: { |
@@ -113,18 +113,22 @@ let | |||
113 | generated = ./bower-packages.nix; | 113 | generated = ./bower-packages.nix; |
114 | src = (mylibs.fetchedGit ./mediagoblin.json).src; | 114 | src = (mylibs.fetchedGit ./mediagoblin.json).src; |
115 | }; | 115 | }; |
116 | withPlugins = plugins: package.overrideAttrs(old: { | 116 | pluginNames = [ "basicsearch" ]; |
117 | name = "${old.name}-with-plugins"; | 117 | allPlugins = lib.attrsets.genAttrs pluginNames |
118 | postBuild = old.postBuild + ( | 118 | (name: callPackage (./plugins + "/${name}") {}); |
119 | builtins.concatStringsSep "\n" ( | 119 | toPassthru = pkg: { |
120 | map (value: "ln -s ${value} mediagoblin/plugins/${value.pluginName}") plugins | 120 | inherit allPlugins; |
121 | ) | 121 | withPlugins = withPlugins pkg; |
122 | ); | 122 | }; |
123 | passthru = old.passthru // { | 123 | withPlugins = pkg: toPlugins: |
124 | inherit plugins; | 124 | let |
125 | withPlugins = morePlugins: old.withPlugins (morePlugins ++ plugins); | 125 | plugins = toPlugins allPlugins; |
126 | }; | 126 | toBuildPlugin = n: "ln -s ${n} mediagoblin/plugins/${n.pluginName}"; |
127 | }); | 127 | newMediagoblin = pkg.overrideAttrs(old: { |
128 | postBuild = old.postBuild + "\n" + builtins.concatStringsSep "\n" (map toBuildPlugin plugins); | ||
129 | passthru = toPassthru newMediagoblin; | ||
130 | }); | ||
131 | in newMediagoblin; | ||
128 | package = stdenv.mkDerivation (mylibs.fetchedGit ./mediagoblin.json // rec { | 132 | package = stdenv.mkDerivation (mylibs.fetchedGit ./mediagoblin.json // rec { |
129 | preConfigure = '' | 133 | preConfigure = '' |
130 | # ./bootstrap.sh | 134 | # ./bootstrap.sh |
@@ -173,9 +177,6 @@ let | |||
173 | ''; | 177 | ''; |
174 | buildInputs = [ makeWrapper automake autoconf which nodePackages.bower nodejs python ]; | 178 | buildInputs = [ makeWrapper automake autoconf which nodePackages.bower nodejs python ]; |
175 | propagatedBuildInputs = with gst_all_1; [ python gst-libav gst-plugins-good gst-plugins-bad gst-plugins-ugly gstreamer ]; | 179 | propagatedBuildInputs = with gst_all_1; [ python gst-libav gst-plugins-good gst-plugins-bad gst-plugins-ugly gstreamer ]; |
176 | passthru = { | 180 | passthru = toPassthru package; |
177 | plugins = []; | ||
178 | inherit withPlugins; | ||
179 | }; | ||
180 | }); | 181 | }); |
181 | in package | 182 | in package |
diff --git a/pkgs/webapps/roundcubemail/default.nix b/pkgs/webapps/roundcubemail/default.nix index 4f288b8..2b22b29 100644 --- a/pkgs/webapps/roundcubemail/default.nix +++ b/pkgs/webapps/roundcubemail/default.nix | |||
@@ -1,6 +1,6 @@ | |||
1 | { varDir ? "/var/lib/roundcubemail" | 1 | { varDir ? "/var/lib/roundcubemail" |
2 | , roundcube_config ? "/etc/roundcube/config.php" | 2 | , roundcube_config ? "/etc/roundcube/config.php" |
3 | , stdenv, fetchurl, jre, unzip }: | 3 | , stdenv, fetchurl, jre, unzip, lib, callPackage }: |
4 | let | 4 | let |
5 | defaultInstall = '' | 5 | defaultInstall = '' |
6 | mkdir -p $out | 6 | mkdir -p $out |
@@ -19,20 +19,39 @@ let | |||
19 | src = fetchurl { inherit url sha256; }; | 19 | src = fetchurl { inherit url sha256; }; |
20 | passthru.pluginName = appName; | 20 | passthru.pluginName = appName; |
21 | }; | 21 | }; |
22 | withPlugins = plugins: skins: package.overrideAttrs(old: { | 22 | skinNames = []; |
23 | name = "${old.name}${if builtins.length skins > 0 then "-with-skins" else ""}${if builtins.length plugins > 0 then "-with-plugins" else ""}"; | 23 | allSkins = lib.attrsets.genAttrs skinNames |
24 | installPhase = old.installPhase + | 24 | (name: callPackage (./skins + "/${name}") {}); |
25 | builtins.concatStringsSep "\n" ( | 25 | pluginNames = [ |
26 | map (value: "ln -s ${value} $out/plugins/${value.pluginName}") plugins | 26 | "automatic_addressbook" "carddav" "contextmenu" |
27 | ) + | 27 | "contextmenu_folder" "html5_notifier" "ident_switch" |
28 | builtins.concatStringsSep "\n" ( | 28 | "message_highlight" "thunderbird_labels" |
29 | map (value: "ln -s ${value} $out/skins/${value.skinName}") skins | 29 | ]; |
30 | ); | 30 | allPlugins = lib.attrsets.genAttrs pluginNames |
31 | passthru = old.passthru // { | 31 | (name: callPackage (./plugins + "/${name}") { inherit buildPlugin; }); |
32 | inherit plugins skins; | 32 | toPassthru = pkg: plugins: skins: { |
33 | withPlugins = morePlugins: moreSkins: old.withPlugins (morePlugins ++ plugins) (morePlugins ++ skins); | 33 | inherit plugins skins allSkins allPlugins; |
34 | }; | 34 | withSkins = withSkins pkg; |
35 | }); | 35 | withPlugins = withPlugins pkg; |
36 | }; | ||
37 | withPlugins = pkg: toPlugins: | ||
38 | let | ||
39 | plugins = toPlugins allPlugins; | ||
40 | toInstallPlugin = n: "ln -s ${n} $out/plugins/${n.pluginName}"; | ||
41 | newRoundcube = pkg.overrideAttrs(old: { | ||
42 | installPhase = old.installPhase + "\n" + builtins.concatStringsSep "\n" (map toInstallPlugin plugins); | ||
43 | passthru = toPassthru newRoundcube (pkg.plugins ++ plugins) pkg.skins; | ||
44 | }); | ||
45 | in newRoundcube; | ||
46 | withSkins = pkg: toSkins: | ||
47 | let | ||
48 | skins = toSkins allSkins; | ||
49 | toInstallSkin = n: "ln -s ${n} $out/skins/${n.skinName}"; | ||
50 | newRoundcube = pkg.overrideAttrs(old: { | ||
51 | installPhase = old.installPhase + "\n" + builtins.concatStringsSep "\n" (map toInstallSkin skins); | ||
52 | passthru = toPassthru newRoundcube pkg.plugins (pkg.skins ++ skins); | ||
53 | }); | ||
54 | in newRoundcube; | ||
36 | shrinker = fetchurl { | 55 | shrinker = fetchurl { |
37 | url = "http://dl.google.com/closure-compiler/compiler-latest.zip"; | 56 | url = "http://dl.google.com/closure-compiler/compiler-latest.zip"; |
38 | sha256 = "0naf3kflhlkm17ls1x7mgddd3b01f8yzbbbdjqwy5m12jmkzl2d5"; | 57 | sha256 = "0naf3kflhlkm17ls1x7mgddd3b01f8yzbbbdjqwy5m12jmkzl2d5"; |
@@ -61,10 +80,6 @@ let | |||
61 | cp -a . $out | 80 | cp -a . $out |
62 | ln -s ${roundcube_config} $out/config/config.inc.php | 81 | ln -s ${roundcube_config} $out/config/config.inc.php |
63 | ''; | 82 | ''; |
64 | passthru = { | 83 | passthru = toPassthru package [] []; |
65 | plugins = []; | ||
66 | skins = []; | ||
67 | inherit withPlugins buildPlugin; | ||
68 | }; | ||
69 | }; | 84 | }; |
70 | in package | 85 | in package |
diff --git a/pkgs/webapps/ttrss/default.nix b/pkgs/webapps/ttrss/default.nix index 0ce2f94..38200a1 100644 --- a/pkgs/webapps/ttrss/default.nix +++ b/pkgs/webapps/ttrss/default.nix | |||
@@ -1,30 +1,33 @@ | |||
1 | { ttrss_config ? "/etc/ttrss/config.php" | 1 | { ttrss_config ? "/etc/ttrss/config.php" |
2 | , varDir ? "/var/lib/ttrss" | 2 | , varDir ? "/var/lib/ttrss" |
3 | , stdenv, mylibs }: | 3 | , stdenv, mylibs, lib, callPackage }: |
4 | let | 4 | let |
5 | withPlugins = plugins: package.overrideAttrs(old: rec { | 5 | pluginNames = [ "auth_ldap" "af_feedmod" "feediron" "ff_instagram" "tumblr_gdpr_ua" ]; |
6 | name = "${old.name}-with-plugins"; | 6 | allPlugins = lib.attrsets.genAttrs pluginNames |
7 | installPhase = old.installPhase + | 7 | (name: callPackage (./plugins + "/${name}") {}); |
8 | builtins.concatStringsSep "\n" ( | 8 | toPassthru = pkg: plugins: { |
9 | map (value: "ln -s ${value} $out/plugins/${value.pluginName}") plugins | 9 | inherit plugins allPlugins; |
10 | ); | 10 | withPlugins = withPlugins pkg; |
11 | passthru = old.passthru // { | 11 | }; |
12 | inherit plugins; | 12 | withPlugins = pkg: toPlugins: |
13 | withPlugins = morePlugins: old.withPlugins (morePlugins ++ plugins); | 13 | let |
14 | }; | 14 | plugins = toPlugins allPlugins; |
15 | }); | 15 | toInstallPlugin = n: |
16 | "ln -sf ${n} $out/plugins/${n.pluginName}"; | ||
17 | newTtrss = pkg.overrideAttrs(old: { | ||
18 | installPhase = old.installPhase + "\n" + builtins.concatStringsSep "\n" (map toInstallPlugin plugins); | ||
19 | passthru = toPassthru newTtrss (pkg.plugins ++ plugins); | ||
20 | }); | ||
21 | in newTtrss; | ||
16 | package = stdenv.mkDerivation (mylibs.fetchedGit ./tt-rss.json // rec { | 22 | package = stdenv.mkDerivation (mylibs.fetchedGit ./tt-rss.json // rec { |
17 | buildPhase = '' | 23 | buildPhase = '' |
18 | rm -rf lock feed-icons cache | 24 | rm -rf lock feed-icons cache |
19 | ln -sf ${varDir}/{lock,feed-icons,cache} . | 25 | ln -sf ${varDir}/{lock,feed-icons,cache} . |
20 | ''; | 26 | ''; |
21 | installPhase = '' | 27 | installPhase = '' |
22 | cp -a . $out | 28 | cp -a . $out |
23 | ln -s ${ttrss_config} $out/config.php | 29 | ln -s ${ttrss_config} $out/config.php |
24 | ''; | 30 | ''; |
25 | passthru = { | 31 | passthru = toPassthru package []; |
26 | plugins = []; | ||
27 | inherit withPlugins; | ||
28 | }; | ||
29 | }); | 32 | }); |
30 | in package | 33 | in package |
diff --git a/pkgs/webapps/yourls/default.nix b/pkgs/webapps/yourls/default.nix index 4bcfa4c..d940c54 100644 --- a/pkgs/webapps/yourls/default.nix +++ b/pkgs/webapps/yourls/default.nix | |||
@@ -1,16 +1,21 @@ | |||
1 | { yourls_config ? "/etc/yourls/config.php", mylibs, stdenv }: | 1 | { yourls_config ? "/etc/yourls/config.php", mylibs, callPackage, lib, stdenv }: |
2 | let | 2 | let |
3 | withPlugins = plugins: package.overrideAttrs(old: { | 3 | pluginNames = [ "ldap" ]; |
4 | name = "${old.name}-with-plugins"; | 4 | allPlugins = lib.attrsets.genAttrs pluginNames |
5 | installPhase = old.installPhase + | 5 | (name: callPackage (./plugins + "/${name}") { inherit mylibs; }); |
6 | builtins.concatStringsSep "\n" ( | 6 | toPassthru = pkg: plugins: { |
7 | map (value: "ln -s ${value} $out/user/plugins/${value.pluginName}") plugins | 7 | inherit plugins allPlugins; |
8 | ); | 8 | withPlugins = withPlugins pkg; |
9 | passthru = old.passthru // { | 9 | }; |
10 | inherit plugins; | 10 | withPlugins = pkg: toPlugins: |
11 | withPlugins = morePlugins: old.withPlugins (morePlugins ++ plugins); | 11 | let |
12 | }; | 12 | plugins = toPlugins allPlugins; |
13 | }); | 13 | toInstallPlugin = n: "ln -s ${n} $out/user/plugins/${n.pluginName}"; |
14 | newYourls = pkg.overrideAttrs(old: { | ||
15 | installPhase = old.installPhase + "\n" + builtins.concatStringsSep "\n" (map toInstallPlugin plugins); | ||
16 | passthru = toPassthru newYourls (pkg.plugins ++ plugins); | ||
17 | }); | ||
18 | in newYourls; | ||
14 | package = stdenv.mkDerivation (mylibs.fetchedGithub ./yourls.json // rec { | 19 | package = stdenv.mkDerivation (mylibs.fetchedGithub ./yourls.json // rec { |
15 | installPhase = '' | 20 | installPhase = '' |
16 | mkdir -p $out | 21 | mkdir -p $out |
@@ -18,9 +23,6 @@ let | |||
18 | cp sample-robots.txt $out/robots.txt | 23 | cp sample-robots.txt $out/robots.txt |
19 | ln -sf ${yourls_config} $out/includes/config.php | 24 | ln -sf ${yourls_config} $out/includes/config.php |
20 | ''; | 25 | ''; |
21 | passthru = { | 26 | passthru = toPassthru package []; |
22 | plugins = []; | ||
23 | inherit withPlugins; | ||
24 | }; | ||
25 | }); | 27 | }); |
26 | in package | 28 | in package |