8 , ensureNewerSourcesForZipFilesHook
16 # pname: plugin id (example: xyz.maubot.echo)
17 # version: plugin version
18 # other attributes are passed directly to stdenv.mkDerivation (you at least need src)
19 buildMaubotPlugin = attrs@{ version, pname, base_config ? null, ... }:
20 stdenvNoCC.mkDerivation (builtins.removeAttrs attrs [ "base_config" ] // {
21 pluginName = "${pname}-v${version}.mbp";
22 nativeBuildInputs = (attrs.nativeBuildInputs or [ ]) ++ [
23 ensureNewerSourcesForZipFilesHook
34 postPatch = lib.optionalString (base_config != null) ''
35 [ -e base-config.yaml ] || (echo "base-config.yaml doesn't exist, can't override it" && exit 1)
36 cp "${if builtins.isPath base_config || lib.isDerivation base_config then base_config
37 else if builtins.isString base_config then builtins.toFile "base-config.yaml" base_config
38 else (formats.yaml { }).generate "base-config.yaml" base_config}" base-config.yaml
39 '' + attrs.postPatch or "";
44 mkdir -p $out/lib/maubot-plugins
45 install -m 444 $pluginName $out/lib/maubot-plugins
51 generated = import ./generated.nix {
52 inherit lib fetchgit fetchFromGitHub fetchFromGitLab
53 fetchFromGitea python3 poetry buildMaubotPlugin;
57 inherit buildMaubotPlugin;
61 (x: x.isOfficial && !x.meta.broken)
62 (builtins.attrValues generated);
67 (builtins.attrValues generated);