···11+diff --git a/tools/yabridgectl/src/config.rs b/tools/yabridgectl/src/config.rs
22+index c1c89cf..d7bd822 100644
33+--- a/tools/yabridgectl/src/config.rs
44++++ b/tools/yabridgectl/src/config.rs
55+@@ -23,6 +23,7 @@ use std::collections::{BTreeMap, BTreeSet};
66+ use std::env;
77+ use std::fmt::Display;
88+ use std::fs;
99++use std::iter;
1010+ use std::path::{Path, PathBuf};
1111+ use which::which;
1212+ use xdg::BaseDirectories;
1313+@@ -216,34 +217,24 @@ impl Config {
1414+ }
1515+ }
1616+ None => {
1717+- // Search in the system library locations and in `~/.local/share/yabridge` if no
1818+- // path was set explicitely. We'll also search through `/usr/local/lib` just in case
1919+- // but since we advocate against installing yabridge there we won't list this path
2020+- // in the error message when `libyabridge-vst2.so` can't be found.
2121+- let system_path = Path::new("/usr/lib");
2222++ // Search through NIX_PROFILES & data home directory if no path was set explicitly.
2323++ let nix_profiles = env::var("NIX_PROFILES");
2424+ let user_path = xdg_dirs.get_data_home();
2525+- let lib_directories = [
2626+- system_path,
2727+- // Used on Debian based distros
2828+- Path::new("/usr/lib/x86_64-linux-gnu"),
2929+- // Used on Fedora
3030+- Path::new("/usr/lib64"),
3131+- Path::new("/usr/local/lib"),
3232+- Path::new("/usr/local/lib/x86_64-linux-gnu"),
3333+- Path::new("/usr/local/lib64"),
3434+- &user_path,
3535+- ];
3636++ let lib_directories = nix_profiles.iter()
3737++ .flat_map(|profiles| profiles.split(' ')
3838++ .map(|profile| Path::new(profile).join("lib")))
3939++ .chain(iter::once(user_path.clone()));
4040++
4141+ let mut candidates = lib_directories
4242+- .iter()
4343+ .map(|directory| directory.join(LIBYABRIDGE_VST2_NAME));
4444++
4545+ match candidates.find(|directory| directory.exists()) {
4646+ Some(candidate) => candidate,
4747+ _ => {
4848+ return Err(anyhow!(
4949+- "Could not find '{}' in either '{}' or '{}'. You can override the \
5050+- default search path using 'yabridgectl set --path=<path>'.",
5151++ "Could not find '{}' through 'NIX_PROFILES' or '{}'. You can override the \
5252++ default search path using 'yabridgectl set --path=<path>'.",
5353+ LIBYABRIDGE_VST2_NAME,
5454+- system_path.display(),
5555+ user_path.display()
5656+ ));
5757+ }
5858+diff --git a/tools/yabridgectl/src/main.rs b/tools/yabridgectl/src/main.rs
5959+index 0db1bd4..221cdd0 100644
6060+--- a/tools/yabridgectl/src/main.rs
6161++++ b/tools/yabridgectl/src/main.rs
6262+@@ -102,7 +102,7 @@ fn main() -> Result<()> {
6363+ .about("Path to the directory containing 'libyabridge-{vst2,vst3}.so'")
6464+ .long_about(
6565+ "Path to the directory containing 'libyabridge-{vst2,vst3}.so'. If this \
6666+- is not set, then yabridgectl will look in both '/usr/lib' and \
6767++ is not set, then yabridgectl will look through 'NIX_PROFILES' and \
6868+ '~/.local/share/yabridge' by default.",
6969+ )
7070+ .validator(validate_path)