Installing sc3-plugins on NixOS

The good news

I believe I’m close to publishing a NixOS package for sc3-plugins.

The problem

Long ago I inistalled SuperCollider (3.11.2) via the NixOS packaging system. And today I think I managed to build sc3-plugins too, by writing a Nix expression for it. But I can’t seem to get SuperCollider to recognize the extensions.

Details

I know scide is working, because I can produce sound from ordinary builtin UGens. But if I try to evaluate, say, this example from the Decimator documentation:

{Decimator.ar(SinOsc.ar([400, 404], 0, 0.2), MouseX.kr(0, 44100), MouseY.kr(0, 31))}.play

I get this error:

-> Synth('temp__3' : 1003)
exception in GraphDef_Recv: UGen 'Decimator' not installed.
*** ERROR: SynthDef temp__3 not found
FAILURE IN SERVER /s_new SynthDef not found

According to Platform.userExtensionDir, my local Extensions folder is /home/jeff/.local/share/SuperCollider/Extensions.

When, in the sc3-plugins folder that Nix built, I search for a folder called SC3plugins, the only result is /nix/store/591z795zn2na6q0976b3ix0lk5nywgkv-sc3-plugins-3.11.1/share/SuperCollider/Extensions/SC3plugins. And it certainly looks like a folder full of extensions:

jeff@jbb-dell:SC3plugins$ pwd
/nix/store/591z795zn2na6q0976b3ix0lk5nywgkv-sc3-plugins-3.11.1/share/SuperCollider/Extensions/SC3plugins
jeff@jbb-dell:SC3plugins$ ls
AntiAliasingOscillators  ConcatUGens      MdaUGens         SkUGens
ATK                      DEINDUGens       MembraneUGens    SLUGens
AuditoryModeling         DistortionUGens  NCAnalysisUGens  StkInst
AYUGens                  DWGUGens         Neuromodules     StkUGens
BatUGens                 GlitchUGens      NHUGens          SummerUGens
BBCut2UGens              HOAUGens         OteyPianoUGens   TagSystemUGens
BerlachUGens             JoshUGens        PitchDetection   TJUGens
BetablockerUGens         LadspaUGen       QuantityUGens    VBAPUGens
BhobUGens                local            RFWUGens         VOSIMUGens
BlackrainUGens           LoopBufUGens     RMEQSuiteUGens
ChaosUGens               MCLDUGens        SCMIRUGens
jeff@jbb-dell:SC3plugins$ tree MdaUGens/
MdaUGens/
├── HelpSource
│   └── Classes
│       └── MdaPiano.schelp
├── MdaUGens.html
└── MdaUGens.sc

2 directories, 3 files

So I made a symlink from my local user extensions folder to that SC3plugins folder:

  jeff@jbb-dell:Extensions$ ln -s /nix/store/591z795zn2na6q0976b3ix0lk5nywgkv-sc3-plugins-3.11.1/share/SuperCollider/Extensions/SC3plugins SC3plugins
  jeff@jbb-dell:Extensions$ pwd
  /home/jeff/.local/share/SuperCollider/Extensions

I know SC is actually paying attention to that user extensions folder, because when I made a symlink to the wrong thing, the server would crash as soon as I booted it, whereas the symlink above allows the server to start normally.

I’m no longer convinced Nix has anything to do with this problem. I’ve started a new post with my latest discoveries.

It’s packaged! And awaiting approval in nixpkgs. Anyone who wants can, of course, already use it, but once it’s approved it’ll be easier – at that point you’ll only need to add the word “sc3-plugins” to your Nix configuration file and rebuild.