aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2020-05-08 23:59:21 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2020-05-09 00:30:49 +0200
commit34c7b88e16d1768b1b9a0cfa6dd21ea5d9b1b308 (patch)
treeb0ace6db106ee8ce19ee17c4cc798dcccf5c77f9
parentc4216ddb8bedd0b75149c039bd5dc86c3d6a9b7f (diff)
downloadNix-34c7b88e16d1768b1b9a0cfa6dd21ea5d9b1b308.tar.gz
Nix-34c7b88e16d1768b1b9a0cfa6dd21ea5d9b1b308.tar.zst
Nix-34c7b88e16d1768b1b9a0cfa6dd21ea5d9b1b308.zip
Use new withPlugin system
- dokuwiki - mantisbt - mediagoblin - roundcube - ttrss - yourls
-rw-r--r--modules/private/websites/tools/git/mantisbt.nix2
-rw-r--r--modules/private/websites/tools/mail/default.nix2
-rw-r--r--modules/private/websites/tools/mail/roundcubemail.nix5
-rw-r--r--modules/private/websites/tools/mgoblin/default.nix2
-rw-r--r--modules/private/websites/tools/tools/dokuwiki.nix2
-rw-r--r--modules/private/websites/tools/tools/ttrss.nix6
-rw-r--r--modules/private/websites/tools/tools/yourls.nix3
-rw-r--r--modules/webapps/mediagoblin.nix29
-rw-r--r--pkgs/webapps/default.nix67
-rw-r--r--pkgs/webapps/dokuwiki/default.nix42
-rw-r--r--pkgs/webapps/mantisbt_2/default.nix42
-rw-r--r--pkgs/webapps/mediagoblin/default.nix35
-rw-r--r--pkgs/webapps/roundcubemail/default.nix55
-rw-r--r--pkgs/webapps/ttrss/default.nix45
-rw-r--r--pkgs/webapps/yourls/default.nix34
15 files changed, 160 insertions, 211 deletions
diff --git a/modules/private/websites/tools/git/mantisbt.nix b/modules/private/websites/tools/git/mantisbt.nix
index 50851aa..a74d76e 100644
--- a/modules/private/websites/tools/git/mantisbt.nix
+++ b/modules/private/websites/tools/git/mantisbt.nix
@@ -46,7 +46,7 @@ rec {
46 $g_ldap_organization = '${env.ldap.filter}'; 46 $g_ldap_organization = '${env.ldap.filter}';
47 ''; 47 '';
48 }]; 48 }];
49 webRoot = (mantisbt_2.override { mantis_config = "/var/secrets/webapps/tools-mantisbt"; }).withPlugins (builtins.attrValues mantisbt_2-plugins); 49 webRoot = (mantisbt_2.override { mantis_config = "/var/secrets/webapps/tools-mantisbt"; }).withPlugins (p: [p.slack p.source-integration]);
50 apache = rec { 50 apache = rec {
51 user = "wwwrun"; 51 user = "wwwrun";
52 group = "wwwrun"; 52 group = "wwwrun";
diff --git a/modules/private/websites/tools/mail/default.nix b/modules/private/websites/tools/mail/default.nix
index 7d7904f..7c60ae4 100644
--- a/modules/private/websites/tools/mail/default.nix
+++ b/modules/private/websites/tools/mail/default.nix
@@ -1,7 +1,7 @@
1{ lib, pkgs, config, ... }: 1{ lib, pkgs, config, ... }:
2let 2let
3 roundcubemail = pkgs.callPackage ./roundcubemail.nix { 3 roundcubemail = pkgs.callPackage ./roundcubemail.nix {
4 inherit (pkgs.webapps) roundcubemail roundcubemail-plugins roundcubemail-skins; 4 inherit (pkgs.webapps) roundcubemail;
5 env = config.myEnv.tools.roundcubemail; 5 env = config.myEnv.tools.roundcubemail;
6 }; 6 };
7 rainloop = pkgs.callPackage ./rainloop.nix { 7 rainloop = pkgs.callPackage ./rainloop.nix {
diff --git a/modules/private/websites/tools/mail/roundcubemail.nix b/modules/private/websites/tools/mail/roundcubemail.nix
index 6875bae..bb7dee9 100644
--- a/modules/private/websites/tools/mail/roundcubemail.nix
+++ b/modules/private/websites/tools/mail/roundcubemail.nix
@@ -1,4 +1,4 @@
1{ env, roundcubemail, roundcubemail-plugins, roundcubemail-skins, apacheHttpd }: 1{ env, roundcubemail, apacheHttpd }:
2rec { 2rec {
3 varDir = "/var/lib/roundcubemail"; 3 varDir = "/var/lib/roundcubemail";
4 activationScript = { 4 activationScript = {
@@ -75,8 +75,7 @@ rec {
75 $config['mime_types'] = '${apacheHttpd}/conf/mime.types'; 75 $config['mime_types'] = '${apacheHttpd}/conf/mime.types';
76 ''; 76 '';
77 }]; 77 }];
78 webRoot = (roundcubemail.override { roundcube_config = "/var/secrets/webapps/tools-roundcube"; }).withPlugins 78 webRoot = (roundcubemail.override { roundcube_config = "/var/secrets/webapps/tools-roundcube"; }).withPlugins (p: [ p.automatic_addressbook p.carddav p.contextmenu p.contextmenu_folder p.html5_notifier p.ident_switch p.message_highlight p.thunderbird_labels ]);
79 (builtins.attrValues roundcubemail-plugins) (builtins.attrValues roundcubemail-skins);
80 apache = rec { 79 apache = rec {
81 user = "wwwrun"; 80 user = "wwwrun";
82 group = "wwwrun"; 81 group = "wwwrun";
diff --git a/modules/private/websites/tools/mgoblin/default.nix b/modules/private/websites/tools/mgoblin/default.nix
index 5224a0d..719d3d3 100644
--- a/modules/private/websites/tools/mgoblin/default.nix
+++ b/modules/private/websites/tools/mgoblin/default.nix
@@ -83,7 +83,7 @@ in {
83 83
84 services.mediagoblin = { 84 services.mediagoblin = {
85 enable = true; 85 enable = true;
86 plugins = builtins.attrValues pkgs.webapps.mediagoblin-plugins; 86 package = pkgs.webapps.mediagoblin.withPlugins (p: [p.basicsearch]);
87 configFile = "/var/secrets/webapps/tools-mediagoblin"; 87 configFile = "/var/secrets/webapps/tools-mediagoblin";
88 }; 88 };
89 services.filesWatcher.mediagoblin-web = { 89 services.filesWatcher.mediagoblin-web = {
diff --git a/modules/private/websites/tools/tools/dokuwiki.nix b/modules/private/websites/tools/tools/dokuwiki.nix
index 26c04b7..5290a96 100644
--- a/modules/private/websites/tools/tools/dokuwiki.nix
+++ b/modules/private/websites/tools/tools/dokuwiki.nix
@@ -19,7 +19,7 @@ rec {
19 install -m 0750 -o ${apache.user} -g ${apache.group} -d ${varDir}/phpSessions 19 install -m 0750 -o ${apache.user} -g ${apache.group} -d ${varDir}/phpSessions
20 ''; 20 '';
21 }; 21 };
22 webRoot = dokuwiki.withPlugins (builtins.attrValues dokuwiki-plugins); 22 webRoot = dokuwiki.withPlugins (p: [ p.farmer p.todo ]);
23 apache = rec { 23 apache = rec {
24 user = "wwwrun"; 24 user = "wwwrun";
25 group = "wwwrun"; 25 group = "wwwrun";
diff --git a/modules/private/websites/tools/tools/ttrss.nix b/modules/private/websites/tools/tools/ttrss.nix
index 48876d3..ce1ab8e 100644
--- a/modules/private/websites/tools/tools/ttrss.nix
+++ b/modules/private/websites/tools/tools/ttrss.nix
@@ -88,7 +88,11 @@ rec {
88 define('LDAP_AUTH_DEBUG', FALSE); 88 define('LDAP_AUTH_DEBUG', FALSE);
89 ''; 89 '';
90 }]; 90 }];
91 webRoot = (ttrss.override { ttrss_config = "/var/secrets/webapps/tools-ttrss"; }).withPlugins (builtins.attrValues ttrss-plugins); 91 webRoot = (ttrss.override { ttrss_config = "/var/secrets/webapps/tools-ttrss"; }).withPlugins (p: [
92 p.auth_ldap p.ff_instagram p.tumblr_gdpr_ua
93 (p.af_feedmod.override { patched = true; })
94 (p.feediron.override { patched = true; })
95 ]);
92 apache = rec { 96 apache = rec {
93 user = "wwwrun"; 97 user = "wwwrun";
94 group = "wwwrun"; 98 group = "wwwrun";
diff --git a/modules/private/websites/tools/tools/yourls.nix b/modules/private/websites/tools/tools/yourls.nix
index cb03b6c..77ac0a3 100644
--- a/modules/private/websites/tools/tools/yourls.nix
+++ b/modules/private/websites/tools/tools/yourls.nix
@@ -40,8 +40,7 @@ rec {
40 define( 'LDAPAUTH_USERCACHE_TYPE', 0); 40 define( 'LDAPAUTH_USERCACHE_TYPE', 0);
41 ''; 41 '';
42 }]; 42 }];
43 webRoot = (yourls.override { yourls_config = "/var/secrets/webapps/tools-yourls"; }).withPlugins 43 webRoot = (yourls.override { yourls_config = "/var/secrets/webapps/tools-yourls"; }).withPlugins (p: [p.ldap]);
44 (builtins.attrValues yourls-plugins);
45 apache = rec { 44 apache = rec {
46 user = "wwwrun"; 45 user = "wwwrun";
47 group = "wwwrun"; 46 group = "wwwrun";
diff --git a/modules/webapps/mediagoblin.nix b/modules/webapps/mediagoblin.nix
index dbc4c2b..19bbc2e 100644
--- a/modules/webapps/mediagoblin.nix
+++ b/modules/webapps/mediagoblin.nix
@@ -15,8 +15,8 @@ let
15 15
16 [app:mediagoblin] 16 [app:mediagoblin]
17 use = egg:mediagoblin#app 17 use = egg:mediagoblin#app
18 config = ${cfg.configFile} ${cfg.workdir}/mediagoblin.ini 18 config = ${cfg.configFile} ${cfg.package}/mediagoblin.ini
19 /mgoblin_static = ${cfg.workdir}/mediagoblin/static 19 /mgoblin_static = ${cfg.package}/mediagoblin/static
20 20
21 [loggers] 21 [loggers]
22 keys = root 22 keys = root
@@ -87,26 +87,13 @@ in
87 package = lib.mkOption { 87 package = lib.mkOption {
88 type = lib.types.package; 88 type = lib.types.package;
89 default = pkgs.webapps.mediagoblin; 89 default = pkgs.webapps.mediagoblin;
90 example = lib.literalExample ''
91 pkgs.webapps.mediagoblin.withPlugins (p: [p.basicsearch])
92 '';
90 description = '' 93 description = ''
91 Mediagoblin package to use. 94 Mediagoblin package to use.
92 ''; 95 '';
93 }; 96 };
94 plugins = lib.mkOption {
95 type = lib.types.listOf lib.types.package;
96 default = [];
97 description = ''
98 Mediagoblin plugins to use.
99 '';
100 };
101 # Output variables
102 workdir = lib.mkOption {
103 type = lib.types.package;
104 default = cfg.package.withPlugins cfg.plugins;
105 description = ''
106 Adjusted Mediagoblin package with plugins
107 '';
108 readOnly = true;
109 };
110 systemdStateDirectory = lib.mkOption { 97 systemdStateDirectory = lib.mkOption {
111 type = lib.types.str; 98 type = lib.types.str;
112 # Use ReadWritePaths= instead if varDir is outside of /var/lib 99 # Use ReadWritePaths= instead if varDir is outside of /var/lib
@@ -187,7 +174,7 @@ in
187 preStart = '' 174 preStart = ''
188 if [ -d ${cfg.dataDir}/plugin_static/ ]; then 175 if [ -d ${cfg.dataDir}/plugin_static/ ]; then
189 rm ${cfg.dataDir}/plugin_static/coreplugin_basic_auth 176 rm ${cfg.dataDir}/plugin_static/coreplugin_basic_auth
190 ln -sf ${cfg.workdir}/mediagoblin/plugins/basic_auth/static ${cfg.dataDir}/plugin_static/coreplugin_basic_auth 177 ln -sf ${cfg.package}/mediagoblin/plugins/basic_auth/static ${cfg.dataDir}/plugin_static/coreplugin_basic_auth
191 fi 178 fi
192 ./bin/gmg -cf ${cfg.configFile} dbupdate 179 ./bin/gmg -cf ${cfg.configFile} dbupdate
193 ''; 180 '';
@@ -198,7 +185,7 @@ in
198 Restart = "always"; 185 Restart = "always";
199 TimeoutSec = 15; 186 TimeoutSec = 15;
200 Type = "simple"; 187 Type = "simple";
201 WorkingDirectory = cfg.workdir; 188 WorkingDirectory = cfg.package;
202 RuntimeDirectory = cfg.systemdRuntimeDirectory; 189 RuntimeDirectory = cfg.systemdRuntimeDirectory;
203 StateDirectory= cfg.systemdStateDirectory; 190 StateDirectory= cfg.systemdStateDirectory;
204 PIDFile = cfg.pids.paster; 191 PIDFile = cfg.pids.paster;
@@ -227,7 +214,7 @@ in
227 Restart = "always"; 214 Restart = "always";
228 TimeoutSec = 60; 215 TimeoutSec = 60;
229 Type = "simple"; 216 Type = "simple";
230 WorkingDirectory = cfg.workdir; 217 WorkingDirectory = cfg.package;
231 RuntimeDirectory = cfg.systemdRuntimeDirectory; 218 RuntimeDirectory = cfg.systemdRuntimeDirectory;
232 StateDirectory= cfg.systemdStateDirectory; 219 StateDirectory= cfg.systemdStateDirectory;
233 PIDFile = cfg.pids.celery; 220 PIDFile = cfg.pids.celery;
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 }:
2rec { 2rec {
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 }:
2let 2let
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 });
43in package 45in 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}:
2let 2let
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 };
41in package 43in 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 }:
2let 2let
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 });
181in package 182in 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 }:
4let 4let
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 };
70in package 85in 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 }:
4let 4let
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 });
30in package 33in 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 }:
2let 2let
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 });
26in package 28in package