- withPlugins = plugins: package.overrideAttrs(old: {
- name = "${old.name}-with-plugins";
- installPhase = old.installPhase + (
- builtins.concatStringsSep "\n" (
- map (value: "ln -sf ${value} $out/lib/plugins/${value.pluginName}") plugins
- )
- );
- installPreloadPhase = ''
- cp ${preloadFile plugins} $out/inc/preload.php
- '';
- passthru = old.passthru // {
- inherit plugins;
- withPlugins = morePlugins: old.withPlugins (morePlugins ++ plugins);
- };
- });
+ pluginNames = [ "farmer" "todo" ];
+ allPlugins = lib.attrsets.genAttrs pluginNames
+ (name: callPackage (./plugins + "/${name}.nix") {});
+ toPassthru = pkg: plugins: {
+ inherit plugins varDir allPlugins;
+ withPlugins = withPlugins pkg;
+ };
+ withPlugins = pkg: toPlugins:
+ let
+ plugins = toPlugins allPlugins;
+ toInstallPlugin = n:
+ "ln -sf ${n} $out/lib/plugins/${n.pluginName}";
+ newDokuwiki = pkg.overrideAttrs(old: {
+ installPhase = old.installPhase + "\n" + builtins.concatStringsSep "\n" (map toInstallPlugin plugins);
+ installPreloadPhase = ''
+ cp ${preloadFile (pkg.plugins ++ plugins)} $out/inc/preload.php
+ '';
+ passthru = toPassthru newDokuwiki (pkg.plugins ++ plugins);
+ });
+ in newDokuwiki;