···1diff --git a/tools/yabridgectl/src/config.rs b/tools/yabridgectl/src/config.rs
2-index bc5ccfc4..c6d119bc 100644
3--- a/tools/yabridgectl/src/config.rs
4+++ b/tools/yabridgectl/src/config.rs
5@@ -23,6 +23,7 @@ use std::collections::{BTreeMap, BTreeSet, HashSet};
···10 use std::path::{Path, PathBuf};
11 use which::which;
12 use xdg::BaseDirectories;
13-@@ -233,34 +234,24 @@ impl Config {
14 }
15 }
16 None => {
···20- // in the error message when `libyabridge-vst2.so` can't be found.
21- let system_path = Path::new("/usr/lib");
22+ // Search through NIX_PROFILES & data home directory if no path was set explicitly.
0023+ let nix_profiles = env::var("NIX_PROFILES");
24 let user_path = xdg_dirs.get_data_home();
25- let lib_directories = [
···35- ];
36+ let lib_directories = nix_profiles.iter()
37+ .flat_map(|profiles| profiles.split(' ')
038+ .map(|profile| Path::new(profile).join("lib")))
39+ .chain(iter::once(user_path.clone()));
40+
···56 ));
57 }
58diff --git a/tools/yabridgectl/src/main.rs b/tools/yabridgectl/src/main.rs
59-index 8c273f92..432619ec 100644
60--- a/tools/yabridgectl/src/main.rs
61+++ b/tools/yabridgectl/src/main.rs
62-@@ -148,7 +148,7 @@ fn main() -> Result<()> {
63- .about("Path to the directory containing 'libyabridge-{vst2,vst3}.so'")
64- .long_about(
65 "Path to the directory containing 'libyabridge-{vst2,vst3}.so'. If this \
66- is not set, then yabridgectl will look in both '/usr/lib' and \
67+ is not set, then yabridgectl will look through 'NIX_PROFILES' and \
···1diff --git a/tools/yabridgectl/src/config.rs b/tools/yabridgectl/src/config.rs
2+index bc5f6a81..0fcd38d3 100644
3--- a/tools/yabridgectl/src/config.rs
4+++ b/tools/yabridgectl/src/config.rs
5@@ -23,6 +23,7 @@ use std::collections::{BTreeMap, BTreeSet, HashSet};
···10 use std::path::{Path, PathBuf};
11 use which::which;
12 use xdg::BaseDirectories;
13+@@ -235,34 +236,27 @@ impl Config {
14 }
15 }
16 None => {
···20- // in the error message when `libyabridge-vst2.so` can't be found.
21- let system_path = Path::new("/usr/lib");
22+ // Search through NIX_PROFILES & data home directory if no path was set explicitly.
23++ // NIX_PROFILES is iterated in reverse from the most specific (the user profile) to
24++ // the least specific (the system profile).
25+ let nix_profiles = env::var("NIX_PROFILES");
26 let user_path = xdg_dirs.get_data_home();
27- let lib_directories = [
···37- ];
38+ let lib_directories = nix_profiles.iter()
39+ .flat_map(|profiles| profiles.split(' ')
40++ .rev()
41+ .map(|profile| Path::new(profile).join("lib")))
42+ .chain(iter::once(user_path.clone()));
43+
···59 ));
60 }
61diff --git a/tools/yabridgectl/src/main.rs b/tools/yabridgectl/src/main.rs
62+index 48cce4fa..209e40e4 100644
63--- a/tools/yabridgectl/src/main.rs
64+++ b/tools/yabridgectl/src/main.rs
65+@@ -151,7 +151,7 @@ fn main() -> Result<()> {
66+ .help("Path to the directory containing 'libyabridge-{vst2,vst3}.so'")
67+ .long_help(
68 "Path to the directory containing 'libyabridge-{vst2,vst3}.so'. If this \
69- is not set, then yabridgectl will look in both '/usr/lib' and \
70+ is not set, then yabridgectl will look through 'NIX_PROFILES' and \