VCV Rack 2 on NixOS / Nix

Hi folks,

I use VCV Rack on NixOS. NixOS is a Linux distribution built on the Nix package management system, which uses the Nix functional programming language to define software packages in a declarative way. Precompiled VCV Rack binaries don’t work natively on NixOS for technical easons I explain in the next paragraph; skip ahead for the current state of VCV Rack 2 on NixOS.

The advantages of using Nix on NixOS include seamless system upgrades, easy switching between different system configurations, and the ability to have different conflicting versions of the same software installed side-by-side in a local software cache called the Nix store; each discrete package and its dependencies are identified by cryptographic hashes so when you start your system or launch an application all the needed package versions are connected by symlinks; if you need to revert to an earlier system configuration or update a shared library version for some applications but not others, Nix just updates the symlinks accordingly instead of actually replacing any software. This comes at a cost of more disk space usage, but the use can periodically purge unused packages and system configurations from the Nix store. Another disadvantage is that because Nix has a unique system for locating shared libraries and other dependencies, Makefiles and other build scripts need to be wrapped to work with dependencies installed via Nix, and most precompiled Linux binaries don’t work on NixOS without being patched to load appropriate shared library versions from the Nix store.

VCV Rack 1 has been available to install via Nix for a while and there’s an open pull request to update this package to the free version of VCV Rack 2: vcv-rack: 1.1.6 -> 2.0.3 by jpotier · Pull Request #148479 · NixOS/nixpkgs · GitHub

I have been testing this Nix package for VCV Rack 2 on my own system; it works great and will hopefully be merged soon. However, Pro is another kettle of fish and it’s discussed a little on the pull request linked above. Pro would probably have to be a separate package from the free version. There are existing Nix packages that patch proprietary binaries at install time so that they can link to dependencies in the Nix store, but the examples I know of are binaries that you can download without authentication, where licenses or subscriptions are checked at runtime, so getting Pro working with Nix would probably require some creative collaboration between VCV devs and Nix packagers. If you have bought Pro or are thinking of buying it and you use NixOS, I’d be interested to hear from you so we can establish whether there’s a userbase for Pro on NixOS and potentially test a Pro package for Nix if that ever comes about.

1 Like

Nix sounds really interesting, such a clever and innovative way to run a system. It sounds a bit like gentoo, if you have everything set correct it’s a dream but it’s a lot of work getting there.

You might be better off emailing support directly about this.

I’m curious though and I’m not sure I understand the issue, from what you’ve said, if you set up the correct symlinks for it then it should work shouldn’t it? Is it just an issue with packaging?

So where most Linux distributions would keep shared libraries in a common directory like /usr/lib, NixOS doesn’t even have a /usr/lib and doesn’t symlink its libraries from a shared location. Instead, each package links to the specific versions of the specific shared libraries it needs in the Nix store, avoiding any path collisions. So in addition to the symlinks, a precompiled binary needs to be patched because the linker stage of compilation has inserted references to shared libraries in /usr/lib and these need to be changed to point to correct Nix store locations.

The specific problem when it comes to VCV Rack Pro is that normally, the Nix package manager would just pull the binary from some public URL, unauthenticated, run a checksum, and do that patching in the background so the user doesn’t have to worry about it. (You’re right to compare it to Gentoo; I think it also shares some traits with BSD ports and container image manifests.) But my understanding is that it can’t do that with VCV Rack Pro because downloading that binary requires being logged in (authenticated) to the VCV Rack web site using an account with a verified purchase. So installing Rack Pro on Nix would require some alternative approach like giving Nix access to the user’s VCV Rack account credentials or providing some mechanism outside the standard package database for patching and installing the binary after the user has manually downloaded it. Actually a relatively easy way to do it would be to run the binary in a container based on a more standard Linux distro, but part of the charm of Nix is that it offers some of the sandboxing and dependency management properties of containers without the CPU overhead.

Anyhow you’re probably right that this is better handled by contacting support directly, but since I only use standalone Rack (though I’m a VCV commercial plugin customer) I want to prove that people would actually use Pro on NixOS before I make the case to VCV Rack devs that they should support this.

I have bought VCV Rack 2 Pro and I’m using NixOS. I’d be very interested in Rack 2 Pro support and I’d be willing to help testing etc.