Mixbus on Nixos - how to install

Support & discussion regarding DAWs and MIDI sequencers.

Moderators: MattKingUSA, khz

Post Reply
Jamesf
Established Member
Posts: 70
Joined: Tue May 28, 2019 12:23 pm
Location: Madrid
Has thanked: 51 times
Been thanked: 13 times

Mixbus on Nixos - how to install

Post by Jamesf »

How to install Mixbus 32C on Nixos - the hacky workaround.

This is a braindump of how I got this to work - part HOWTO, and part detective story. There's a better way of doing all this, but you need to know what needs doing before you can find the better way. It probably also works for regular Mixbus, but I haven't tested that. The important bit is that there _is_ a way.

It's important to me, at least, because with a native installation I don't need to run Ubuntu Studio in a VM. That's mostly important because you can't run Virtualbox VMs on a realtime kernel, and I'm way too lazy and impatient to dual-boot, never mind repeatedly switch between kernels.

I solved the problem out of order, and I'll give the solutions in a different order to that in which I found them, because I found the most important one later. I'm also assuming you're a reasonably experienced Linux sysadmin and Nixos user, or have easy access to one, to avoid turning this into a dissertation on Linux and Nixos internals.

What you need to do:

- Locate the dynamic loader that the installer relies on: `ld-linux-x86-64.so.2`. I found it via `nix-locate`, which is available at https://github.com/bennofs/nix-index but you can always do it the old-fashioned way: `ls -l /nix/store/*glibc-2.32/lib/ld-linux-x86-64.so.2`
- Having found the loader, symlink to it from `/lib64/ld-linux-x86-64.so.2`. In order to do this, you need to `mkdir /lib64` and hope the Nixos maintainers don't catch you. I did this with `sudo ln -s /nix/store/9l06v7fc38c1x3r2iydl15ksgz0ysb82-glibc-2.32/lib/ld-linux-x86-64.so.2 /lib64/ld-linux-x86-64.so.2` but the exact path will depend on your local installation. This is the bit I'm sure can be done in a more Nix-ish way.
- Create a suitable `shell.nix` file to run it in, assuming you want to keep it local; I've copied my version below. It seems to need the paths to these libraries explicitly added to the environment.
- Invoke that nix-shell, e.g. `nix-shell ~/nix-shells/mixbus.nix'
- Untar the installer somewhere suitable, like in a temp directory: `tar xf ~/sourcery/Mixbus32C-6.2.70-Linux-64bit-gcc5.tar`. Yes, that's where I keep my sources. Yes, I'm that kind of dork.
- Run the installer: `sudo ./Mixbus32C-6.2.70-x86_64-gcc5.run` - it needs `sudo` at some point, so you may as well start that way.
- Now you'll see a long stream of complaints about libraries not found, the line "!!! ERROR !!! - Missing library detected!" and a request to "Press ENTER to exit installer". DO NOT press Enter (yet).
- In a separate terminal, find the unpacked archive: `ls -d /tmp/selfgz*`. Copy that somewhere else, before the shell-script gets a chance to delete it, with a command similar to this: `cp -a /tmp/selfgz2891710178 /tmp/Mixbus_installer`
- Now go back to the terminal you're running the installer in, and press Enter. It'll most likely complain that `/bin/rm` doesn't exist, because Nixos takes the LSB and chucks it out the window. It may not in your environment, hence the previous step.
- Go to the newly copied directory: `cd /tmp/Mixbus_installer`.
- Ignore `install.sh`, and edit `.stage2.run` (note the leading dot). Delete or comment-out the sections headed with "# check the main App(s)" and "# check the libs" - these are the bits that cause it to bail out.
- Now run it: `sudo ./.stage2.run`. It'll complain about the lack of writable system icon and system menu directories, and a few other things, but it'll run. Well, it does for me.
- Have a glass of water. If you don't already need it, you're about to. You've just installed Mixbus, so you're probably going to have too much fun to remember to look after yourself.
- Create a link to the run-script: `ln -s /opt/Mixbus32C-6.2.70/bin/mixbus32c6 ~/bin/mixbus` - or wherever you keep these things. Everybody uses `~/bin`, don't they?
- If you plan to use it with Jack, now's probably a good time to start that up.
- Run Mixbus! You need to do this from the CLI, after invoking the nix-shell, unless there's a better solution I'm not aware of - and let's face it, there probably is.


My `shell.nix` file:
```
with import <nixpkgs> {};

stdenv.mkDerivation rec {
name = "mixbus";

buildInputs = [];

env = buildEnv {
name = name;
paths = buildInputs;
};

LD_LIBRARY_PATH = stdenv.lib.makeLibraryPath [
pkgs.gcc-unwrapped # Provides libstdc++ v6
pkgs.xorg.libX11
pkgs.xorg.libXext
pkgs.xorg.libXrender
pkgs.xorg.libxcb
pkgs.alsaLib
pkgs.jack2
pkgs.libGL
pkgs.librsvg
];

}
```

Please feel free to comment with any questions or refinements, and I'll update this as I figure out a cleaner way of doing it - particularly the bit about linking to the dynamic loader.

Big thanks to the Harrison Support team for being helpful and supportive!
Post Reply