From 3d1e3ee99be86b5535c371d13b94a9af02c0ce06 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Tue, 25 Jun 2024 11:29:33 +0100 Subject: [PATCH] synapse: Set LD_LIBRARY_PATH when running Synapse Set LD_LIBRARY_PATH but only when running Synapse via `devenv up`. This allows Synapse to run and find the libs it needs, while also preventing breakages in the shell due to including `gcc` as a dependency. --- project-flakes/synapse/module.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/project-flakes/synapse/module.nix b/project-flakes/synapse/module.nix index 6693f11..0ff07d2 100644 --- a/project-flakes/synapse/module.nix +++ b/project-flakes/synapse/module.nix @@ -114,7 +114,9 @@ EOF ''; # Start synapse when `devenv up` is run. - processes.synapse.exec = "poetry run python -m synapse.app.homeserver -c homeserver.yaml -c homeserver-config-overrides.d"; + # We set LD_LIBRARY_PATH to counteract the unsetting below, + # so that Synapse has the libs that it needs. + processes.synapse.exec = "LD_LIBRARY_PATH=$DEVENV_ROOT/.devenv/profile/lib poetry run python -m synapse.app.homeserver -c homeserver.yaml -c homeserver-config-overrides.d"; # Clear the LD_LIBRARY_PATH environment variable on shell init. #