diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-05-08 23:59:21 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-05-09 00:30:49 +0200 |
commit | 34c7b88e16d1768b1b9a0cfa6dd21ea5d9b1b308 (patch) | |
tree | b0ace6db106ee8ce19ee17c4cc798dcccf5c77f9 /pkgs/webapps/mantisbt_2 | |
parent | c4216ddb8bedd0b75149c039bd5dc86c3d6a9b7f (diff) | |
download | Nix-34c7b88e16d1768b1b9a0cfa6dd21ea5d9b1b308.tar.gz Nix-34c7b88e16d1768b1b9a0cfa6dd21ea5d9b1b308.tar.zst Nix-34c7b88e16d1768b1b9a0cfa6dd21ea5d9b1b308.zip |
Use new withPlugin system
- dokuwiki
- mantisbt
- mediagoblin
- roundcube
- ttrss
- yourls
Diffstat (limited to 'pkgs/webapps/mantisbt_2')
-rw-r--r-- | pkgs/webapps/mantisbt_2/default.nix | 42 |
1 files changed, 22 insertions, 20 deletions
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 |