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/yourls/default.nix | |
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/yourls/default.nix')
-rw-r--r-- | pkgs/webapps/yourls/default.nix | 34 |
1 files changed, 18 insertions, 16 deletions
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 |