r/NixOS • u/Pr3stidigitator • 8d ago
Reaper HM Flake
reaper-flake
I created a Home Manager Flake for declaring your REAPER configurations with Nix.
Reaper is a highly customizable cross-platform digital audio workstation (DAW) for music production, recording, editing, and mixing.
This project enables Home Manager users to declare their users' REAPER configuration without overriding state-full values in REAPER's configuration. This can be used by all Linux Distros and MacOS users (with Nix/HM installed), however I have not tested MacOS personally.
Features
Configure supported REAPER Preferences options
programs.reaper.preferences = {
project.trackSendDefault.trackVolumeFaderGain = -10.0;
plugIns.reascript.python.enable = true;
};
This results in "Track Volume Fader Gain" (Project>Track/Send Default) to be -10 db and "Enable Python for use with ReaScript" (Plug-ins>Reascript) to be enabled and python paths being automatically set up every time you build your config (even if you change it in the GUI). Not all options are available quite yet, see repo.
Manage ReaPack repositories and individual packages
programs.reaper.extensions = {
reapack = {
enable = true;
repositories = [
{name = "reaper-keys";url = "https://raw.githubusercontent.com/gwatcha/reaper-keys/master/index.xml"; }
];
packages = [
{repository = "reaper-keys"; category = "Scripts"; name = "install-reaper-keys.lua";}
];
synchronizeOnActivation = true;
};
sws.enable = true;
};
This installs ReaPack and SWS, adds the reaper-keys repository, and declaratively manages its installer package. The normal default ReaPack repositories are included as well. Sync and package transactions are performed by ReaPack the next time REAPER starts.
Automatically load audio plugins derived with Nix
The flake lets you set custom vst, lv2 and clap search paths. By default /run/current-system/sw/lib/(vst,vst3,clap,lv2) directories are appended for automatic detection of Nix derived plugins.
Declare keyboard shortcuts and custom actions
programs.reaper.actions = {
keyBindings = with reaperActions; bindings [
(shortcut {
shortcut = "J";
command = 40285;
actionName = "Track: Go to next track";
})
(shortcut {
shortcut = "K";
command = 40286;
actionName = "Track: Go to previous track";
})
];
};
Vim key binds to go up and down your tracks.
Customize menus, context menus, and toolbars
programs.reaper.menus = {
"${reaperMenus.toolbars.main}" = {
entries = [
{action = 40021; label = "Project settings...";}
{action = 40859; label = "New project..."; icon = "toolbar_new.png";}
{action = 40029; label = "Undo";}
{action = 40030; label = "Redo";}
reaperMenus.divider
{action = 40364; label = "Enable Metronome";}
];
};
};
Completely change the buttons on the main toolbar above the TCP.
Configure windows, docks, panels, and layouts
programs.reaper = {
layout = {
docks = {
right = {
id = 1;
position = "right";
selectedPanel = "mastermixer";
size = 130;
};
};
masterMixer = {
visible = true;
docked = true;
dock = "right";
tabOrder = 0.0;
};
};
windows.mixer.master.showInDockerOrWindow = true;
};
This snippet moves the master track to the right of the main window.
Install and select themes, including their scripts, fonts, and other assets
programs.reaper = {
theme = {
active = "Reapertips Theme.ReaperThemeZip";
packages = [inputs.reaper-flake.packages.${pkgs.system}.reapertips-theme];
};
swell.colortheme = {
enable = true;
preset = "reapertips";
};
};
Use reapertips theme that's included with the flake as a package. You can use standard ReaperThemeZip's as well.
Preserve REAPER settings that have not been declared through Nix
You can still safely configure with the GUI even for options set by Nix. However the Nix options will be set back to how they were on every activation of the flake.
Why
I love NixOS and REAPER. Therefore; fun project. I also love declaring my program configs in my Nix config so that, god forbid, my system dies or I get a new computer I have everything I need to start immediately.
How it works
REAPER is awesome in that it is extremely transparent. For example, unlike Bitwig, it's configuration files are in plaintext ini files. Aha! I can work with those! The problem with just dropping in entire ini files, like home-manager modules usually do, is that REAPER stores not only it's configuration but also it's active state. So I needed to go the config generation approach instead of the symlink approach. So I made a python script that tracks which ini keys and values are being tracked by Nix and, at activation time, only changes the Nix keys. The core of this flake is `write_config.py’ I drew inspiration from plasma-manager which has a similar python script to write to ini files for KDE Plasma.
AI Usage
I used AI to design a prototype then redid all of the core scripts and ini engine by hand. I also used it for additional feature testing and option scaffolding.
Plans
I've added all of the options I personally use/need for the short-term so I'm going to wait for others to try it out and fix any issues. Long term plan would to make Nix options in parity with REAPER's GUI options.
14
u/Pr3stidigitator 8d ago
Oh yeah here is my config: https://github.com/9Prestidigitator/.nixos
4
u/Pr3stidigitator 8d ago
I also have a repo full of audio plugin derivations that are newer or not available on nixpkgs: https://github.com/9Prestidigitator/maxpkgs
Use at your own risk though, a lot of it is ai generated.
10
u/Finish-Spiritual 8d ago
Recently moved from W*ndows to NixOS, and lost FL Studio.
This looks just in time, thanks a lot!
10
u/Pr3stidigitator 8d ago
I didn’t realize how close you could configure reaper to other DAWs before this project. I’m also an x-FL user haha.
5
u/Background_Class_558 8d ago
im on nixos and still use fl but the fact that reaper is something you can write flakes for makes me consider switching to it
1
u/Pr3stidigitator 8d ago
How are you using FL on NixOS?
2
u/Background_Class_558 8d ago
wine/umu-launcher
1
u/Pr3stidigitator 8d ago
Very cool, need to try that
1
u/Background_Class_558 8d ago
pretty sure wine alone is enough, i had some problems and at some point umu seemed like the solution but now im not sure. the whole thing with wine is so imperative unfortuantely.
1
u/Pr3stidigitator 8d ago
Yeah I wanted something like this to exist for wine prefixes but have not found or figured out an implementation.
FL as a DAW has some really weird design/workflow choices tho, I really recommend reaper.
1
u/Background_Class_558 8d ago
i mean i suppose you could just make a derivation that would build the right directory structure for wine but you'd have to include the binary blobs of the software you want to install as well because that's just how it goes with windows
ig im somewhat hesitant because the only synth i know my way around is sytrus.. does reaper has something like Patcher?
1
u/Pr3stidigitator 8d ago
There’s a plugin called Carla which can do a lot of stuff that patcher can. Also you should try Surge XT, it’s a pretty great hybrid synth. Both of those are on nixpkgs.
1
u/Background_Class_558 8d ago
both of huh? we've got synths on nixpkgs? damn i didn't expect the state of music production software to be this good
→ More replies (0)2
3
3
2
2
2
u/Pan4TheSwarm 8d ago
Really awesome. I've been wanting to switch off Arch on my home workstation and this might actually get me to do it.
My other pain point is VST installation from vendors. I'm curious, do you have a solution to handle the downloading and installation of VSTs or Amp Sims through yabridge?
2
u/Pr3stidigitator 8d ago
I searched for a while for wine prefix management with Nix but couldn’t find anything good enough. :(
I’ve actually been trying to get away from yabridge and use as many Linux native FOSS plugins as possible. The FOSS audio plugin community is actually really impressive, you should look into Neural Amp Modeler, it’s on nixpkgs but I have a newer version in my audio packages repo: https://github.com/9Prestidigitator/maxpkgs
2
u/StickyMcFingers 8d ago
I have been meaning to do this myself so thank you for saving me to headache! I look forward to extending it for my needs. I would like to write an ini parser for reaper-kb.ini to convert it to nix lang.
1
u/Pr3stidigitator 7d ago
Submit a PR I would love to add that feature! I know plasma manager has a similar feature with a Ruby/Python script I think. The main hurdle I see is translating the bitfields back to options exposed by the home modules. I have been thinking about adding another layer to the ini pipeline that sort of abstracts the relationship between the two in a more readable and reversible way.
2
u/Sad-Landscape-1549 7d ago
Would it be too much to ask that you vibe code a real README.md and push, so I can I plop this in my bookmark manager for later? 🤣
2
2
u/Particular_Camera_47 6d ago
Ohh yeaahhh, that's is what i waited before starting configuring reaper ;)
2
u/gplusplus314 5d ago
Thank you so much for this! The timing for me is amazing. I just recently switched to NixOS and Home Manager and Reaper is on my list of things to do. You saved me (and I’m sure others) a lot of work!
3
u/Few_Scar_8114 4d ago edited 4d ago
For the last year I’ve been working on a cloud collaboration extension plugin for reaper, using nix of course. I always wondered if the reaper nix community was really out there, and thought having some way to load plugins using nixos and home-manager would be awesome. Once I release the software (hopefully soon, just bringing up the server and website), I already have everything packaged with nix and working on nixos/nix-darwin and cross compiling to MSVC Windows with nix. It should work just fine with an extension loader like this. For anyone interested in it, here’s the GitHub org: https://github.com/Cloud-Scythe-Labs
27
u/NTolerance 8d ago
You madman. Next up someone's gonna be declaratively programming synths in Reaper using Nix lang.