1
0
Fork 0
mirror of https://github.com/youwen5/nixos.git synced 2025-03-01 14:51:10 -08:00

feat: override reaper to add PIPEWIRE_LATENCY for very low latency

This commit is contained in:
Youwen Wu 2025-01-24 12:50:28 -08:00
parent 06adf83d0e
commit a91aa4c762
Signed by: youwen5
GPG key ID: 865658ED1FE61EC3

View file

@ -35,9 +35,50 @@ in
yabridgectl
alsa-scarlett-gui
])
++ (lib.optionals config.liminalOS.config.allowUnfree [
pkgs.reaper
])
++ (lib.optionals config.liminalOS.config.allowUnfree (
with pkgs;
[
(reaper.overrideAttrs (
finalAttrs: prevAttrs: {
installPhase = ''
runHook preInstall
HOME="$out/share" XDG_DATA_HOME="$out/share" ./install-reaper.sh \
--install $out/opt \
--integrate-user-desktop
rm $out/opt/REAPER/uninstall-reaper.sh
# Dynamic loading of plugin dependencies does not adhere to rpath of
# reaper executable that gets modified with runtimeDependencies.
# Patching each plugin with DT_NEEDED is cumbersome and requires
# hardcoding of API versions of each dependency.
# Setting the rpath of the plugin shared object files does not
# seem to have an effect for some plugins.
# We opt for wrapping the executable with LD_LIBRARY_PATH prefix.
# Note that libcurl and libxml2 are needed for ReaPack to run.
wrapProgram $out/opt/REAPER/reaper \
--prefix LD_LIBRARY_PATH : "${
lib.makeLibraryPath [
curl
lame
libxml2
ffmpeg
vlc
xdotool
stdenv.cc.cc
]
}" \
--prefix PIPEWIRE_LATENCY : "128/48000"
mkdir $out/bin
ln -s $out/opt/REAPER/reaper $out/bin/
runHook postInstall
'';
}
))
]
))
);
musnix.enable = cfg.enable;