feat: fixed opensearch and elasticsearch

This commit is contained in:
Nick 2025-11-22 00:38:45 -06:00
parent 8c4d36d89b
commit 81af972cca

View file

@ -322,9 +322,33 @@ in
};
mastodon-init-db.serviceConfig.EnvironmentFile = "/var/lib/mastodon/.secrets_env";
systemd-tmpfiles-setup.after = [ "var-lib-mastodon.mount" ];
};
systemd-tmpfiles-setup.after = [ "var-lib-mastodon.mount" ];
opensearch-install-plugins = {
description = "Install OpenSearch plugins";
before = [ "opensearch.service" ];
requiredBy = [ "opensearch.service" ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
};
script = ''
PLUGIN_DIR="/var/lib/opensearch/plugins/analysis-icu"
if [ ! -d "$PLUGIN_DIR" ]; then
# Create the plugins directory if it doesn't exist
mkdir -p /var/lib/opensearch/plugins
# Install using the proper OpenSearch plugin command
export OPENSEARCH_JAVA_HOME="${pkgs.jdk17}/lib/openjdk"
${pkgs.opensearch}/bin/opensearch-plugin install --batch analysis-icu || {
echo "Plugin installation failed, but continuing anyway"
exit 0
}
fi
'';
};
};
timers.fedifetcher = {
description = "Timer for FediFetcher";
wantedBy = [ "timers.target" ];