Setting up tidal via nix

Does anyone know how to set tidal with nix as package manager?

(This has probably been discussed here, but I couldn't find it.)

I'm using emacs as editor and tried:

nix-shell -p emacs ghc haskellPackages.tidal emacsPackages.tidal cabal-install supercollider-with-sc3-plugins

Then I added this to my emacs config file:

(setq tidal-boot-script-path "/nix/store/bzgli70i0nnwn8ksq849qhwxhlb9fiqw-tidal-1.9.2-data/share/ghc-9.2.8/x86_64-linux-ghc-9.2.8/tidal-1.9.2/BootTidal.hs")

But when I try to start tidal, I get this error:

ghci> 
<no location info>: error:
    Could not find module `Sound.Tidal.Context'
    It is not a module in the current program, or in any known package.

I found this, but couldn't figure how to adapt that to nix.

Does anyone know what I'm doing wrong?

I normally use Tidal through Pulsar in my NixOS system, but since I want to use Emacs at some point, I can write up a Nix expression that helps you with this.

In the Tidal docs, this shows up in the instructions for Doom Emacs. Is this the Emacs you are trying to configure?

Also, on which OS are you using the Nix package manager?

@famubu

I figured it out. In order to make ghc aware of tidal, use this expression:

nix-shell -p emacs emacsPackages.tidal "haskellPackages.ghcWithPackages (ps: [ ps.tidal ])" supercollider-with-sc3-plugins

Reference: [WIP]: NixOS: (Jack / Pro) Audio Infrastructure · Issue #71283 · NixOS/nixpkgs · GitHub