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;
    # Only if you're using stylix
    preset = "stylix";
  };
};

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.

6 Likes

I currently use GitHub - mrtnvgr/reanix: REAPER configuration system for NixOS · GitHub (I never use Reaper, but I do have it configured ;), but might have to switch to this so I can declare ReaPack management (Although I do have a LOT of ReaPack extensions, so packages will be long.). Cool project, though!

2 Likes

I’m just now going down the reaper scripting rabbit hole. It’s pretty amazing. I broke my personal reaper-flake configuration up into multiple files for my sanity… it’s so large now.

1 Like

Oh cool you use flake-parts/dendritic pattern!
I “use” (have installed) all of JoepVanlier’s extensions (JSFX, Hackey-Trackey, Hackey-Machines) and all of BirdBird’s extensions, as well as MK Slicer.

Oh also the ReaperTips theme ofc.

1 Like

Just abstracted the ini pipeline layer, which allowed me to add a reaper ini to nix converter. This should make it easier for you to add your reaper scripts and extensions declaratively since you can do it imperitively first.

1 Like

Just switched over! Probably has some bugs (and missing features I did not add right now, would like to generate the reapack.packages section directly from the XMLs in the future, and have an update script for my pinned ReaPack repos)

Now I need something like this for Renoise so I can get rid of the rest of the DAWS.org manual installation instructions (then maybe actually make music using either/both of them…).

Thanks for this awesome project!

1 Like

Awesome REAPER config. Will definitely have to check out what extensions you use. I should implement top-level sws color options… maybe I will do that next!

1 Like