1From 1217722e4bf6c65b5c24da17a7de4bf712ca6775 Mon Sep 17 00:00:00 2001
2From: Tamara Schmitz <tamara.zoe.schmitz@posteo.de>
3Date: Sat, 17 Jun 2023 14:05:53 +0200
4Subject: [PATCH] add NixOS plugin paths as default search paths
5
6Since NixOS uses unusual paths, we should tell Ardour about this. During
7first launch, Ardour does indeed check for environmentals but not when
8you press the "Reset to Defaults" button in the Settings menu. This
9path fixes this by including NixOS paths in the defaults.
10---
11 libs/ardour/plugin_manager.cc | 5 +++--
12 libs/ardour/search_paths.cc | 4 ++++
13 2 files changed, 7 insertions(+), 2 deletions(-)
14
15diff --git a/libs/ardour/plugin_manager.cc b/libs/ardour/plugin_manager.cc
16index a572ed55dd..3dd6c2fda6 100644
17--- a/libs/ardour/plugin_manager.cc
18+++ b/libs/ardour/plugin_manager.cc
19@@ -305,7 +305,8 @@ PluginManager::PluginManager ()
20 if (lxvst_path.length() == 0) {
21 lxvst_path = "/usr/local/lib64/lxvst:/usr/local/lib/lxvst:/usr/lib64/lxvst:/usr/lib/lxvst:"
22 "/usr/local/lib64/linux_vst:/usr/local/lib/linux_vst:/usr/lib64/linux_vst:/usr/lib/linux_vst:"
23- "/usr/lib/vst:/usr/local/lib/vst";
24+ "/usr/lib/vst:/usr/local/lib/vst:$HOME/.nix-profile/lib/vst:"
25+ "$HOME/.lxvst:$HOME/.nix-profile/lib/lxvst:/run/current-system/sw/lib/lxvst:/etc/profiles/per-user/$USER/lib/lxvst";
26 }
27
28 /* first time setup, use 'default' path */
29@@ -2040,7 +2041,7 @@ PluginManager::vst3_refresh (bool cache_only)
30 std::string prog = PBD::get_win_special_folder_path (CSIDL_PROGRAM_FILES);
31 vst3_discover_from_path (Glib::build_filename (prog, "Common Files", "VST3"), cache_only);
32 #else
33- vst3_discover_from_path ("~/.vst3:/usr/local/lib/vst3:/usr/lib/vst3", cache_only);
34+ vst3_discover_from_path ("~/.vst3:/usr/local/lib/vst3:/usr/lib/vst3:~/.nix-profile/lib/vst3:/run/current-system/sw/lib/vst3:/etc/profiles/per-user/$USER/lib/vst3", cache_only);
35 #endif
36 }
37
38diff --git a/libs/ardour/search_paths.cc b/libs/ardour/search_paths.cc
39index e6d8744369..b9774cb006 100644
40--- a/libs/ardour/search_paths.cc
41+++ b/libs/ardour/search_paths.cc
42@@ -112,6 +112,10 @@ ladspa_search_path ()
43 spath.push_back ("/usr/local/lib/ladspa");
44 spath.push_back ("/usr/lib64/ladspa");
45 spath.push_back ("/usr/lib/ladspa");
46+ spath.push_back ("/run/current-system/sw/lib/ladspa");
47+ spath.push_back (path_expand ("$HOME/.ladspa"));
48+ spath.push_back (path_expand ("$HOME/.nix-profile/lib/ladspa"));
49+ spath.push_back (path_expand ("/etc/profiles/per-user/$USER/lib/ladspa"));
50 #endif
51
52 #ifdef __APPLE__
53--
542.40.1
55