- withPlugins = plugins: package.overrideAttrs(old: {
- name = "${old.name}-with-plugins";
- installPhase = old.installPhase +
- builtins.concatStringsSep "\n" (
- map (value: "ln -s ${value} $out/user/plugins/${value.pluginName}") plugins
- );
- passthru = old.passthru // {
- inherit plugins;
- withPlugins = morePlugins: old.withPlugins (morePlugins ++ plugins);
- };
- });
+ pluginNames = [ "ldap" ];
+ allPlugins = lib.attrsets.genAttrs pluginNames
+ (name: callPackage (./plugins + "/${name}") { inherit mylibs; });
+ toPassthru = pkg: plugins: {
+ inherit plugins allPlugins;
+ withPlugins = withPlugins pkg;
+ };
+ withPlugins = pkg: toPlugins:
+ let
+ plugins = toPlugins allPlugins;
+ toInstallPlugin = n: "ln -s ${n} $out/user/plugins/${n.pluginName}";
+ newYourls = pkg.overrideAttrs(old: {
+ installPhase = old.installPhase + "\n" + builtins.concatStringsSep "\n" (map toInstallPlugin plugins);
+ passthru = toPassthru newYourls (pkg.plugins ++ plugins);
+ });
+ in newYourls;