Skip to content

senkowo/guix-channel

Repository files navigation

yumi

A personal Guix channel

This channel contains mostly non-free software I personally use, which I could not find packaged anywhere else.

Programs provided by this channel:

  • Renoise

Installation

Add this channel to ~/.config/guix/channels.scm like this:

(cons* (channel
        (name 'yumi)
        (url "https://github.com/senkowo/guix-channel")
        ;; Enable signature verification:
        (introduction
         (make-channel-introduction
          "d1256cf136ced2ed4a3736417fbced678bacb1f6"
          (openpgp-fingerprint
           "864D 7D40 2260 D1A5 E9B9  AC9B B703 FEDE 1CF1 30EA"))))
       %default-channels)

Renoise

Renoise is a non-free, modern, tracker-based DAW with demo and paid versions.

Homepage: https://www.renoise.com

Package definition: ./yumi/packages/renoise.scm

The renoise package, by default, pulls a copy of the demo-version installer from the Renoise website.

Installing the demo version

To install the demo version, you simply install the package as renoise.

Install from a file

To install Renoise from an installer saved on your system (necessary for the paid/full version), you must apply a transformation to the package. This can be done in several ways:

Using command-line arguments

Command to install:

$ guix install --with-source=renoise@<version>=<path-to-installer> renoise@<version>

So for example:

$ guix install --with-source=renoise@3.4.3=/home/yui/Downloads/rns_343_linux_x86_64.tar.gz renoise@3.4.3

This will install Renoise verison 3.4.3 in the default profile using an installer found at the path specified. The installer must be a tar.gz file.

Some explanations:

  • The --with-source=renoise@<version>= transformation essentially adds the file found at <path> to the guix store, similar to what the command guix download does, but to be specifically used for building the specified package.
  • You should specify the exact Renoise version, because otherwise, if I add a new Renoise version to the channel, you will update to a newer Renoise package, but using an older Renoise installer, which might be problematic.
    • (Does anyone know how this could be mitigated in the renoise package definition? More info under Contributing.)

Using Scheme

The following code applies the same transformation to the renoise package and provides it with variable renoise-custom.

(use-modules (gnu packages)
             (guix transformations))

(define transform-install-path
  (options->transformation
   '((with-source
      . "renoise@3.4.3=/home/yui/Downloads/rns_343_linux_x86_64.tar.gz"))))

(define-public renoise-custom
  (transform-install-path (specification->package "renoise@3.4.3")))

If you want to install this to the default profile, you could simply append renoise-custom to the end of the file, then run $ guix install -f <path-to-file>.

Personally, I like to add it to a pre-existing manifest in another file, like this:

(define-public renoise-manifest
  (cons*
   ;; renoise pacakge
   renoise-custom
   ;; misc
   (specifications->packages
    '("jack"
      "jack2"
      "qjackctl"
      "alsa-utils"
      "programming-socks"))))

Using a package variant

Instead of returning simply the original package but with a transformation applied to it, you can instead create an entirely new package variant. I’ve had mixed results with doing this, and I would personally stick to the previous methods described, but this is always an option.

An example:

(define transform-install-path
  (options->transformation
   '((with-source
      . "renoise@3.4.3=/home/yui/Downloads/rns_343_linux_x86_64.tar.gz"))))

(define-public renoise-full-3.4.3
  (package
    (inherit
     (transform-install-path 
      (specification->package "renoise@3.4.3"))) ; make sure to specify version
    (name "renoise-full")))

This will provide a package called renoise-full that has the transformations applied to it already. It’s important to specify renoise@<version> after specification->package, or else when I add a new Renoise version that can be installed, it will inherit from that package instead, but using the older sources you specified, which can cause issues.

Prevent guix gc from deleting sources in store

If you installed Renoise from a local file, after running guix gc, it may delete its setup files from the Guix store, requiring having to refetch the installer when rebuilding the package. When this happens, the package transformation will need to point to a valid path to the installer.

I personally prefer to delete the Renoise installer after installing it onto my system, just to wipe out any possibility of accidentally uploading my paid copy of Renoise somewhere. But if Guix deletes the Renoise setup files from the store, it will expect the installer to be where I specified it in the transformation. So to deal with this, you can make Guix never delete the Renoise sources.

To prevent Guix from deleting the Renoise sources from the store, run the following:

$ guix build --with-source=renoise@<ver>=<path> --root=<symlink-path> renoise@<ver>

This will create a symlink at <symlink-path>, which points to the Renoise sources store. For as long as this symlink exists, guix gc will not remove the sources from the store. You should now be able to delete the Renoise installer in your home directory, without the fear of guix gc deleting the sources and having to re-fetch the installer.

If you created a package variant

If you created a Renoise package variant that applies the transformation, the command to run is a little bit different:

$ guix build --with-source=renoise-full@<ver>=<path> --root=<symlink-path> renoise-full@<ver> (this is assuming the package name is renoise-full)

The package name specified after --with-source= and at the very end must match your package variant’s name.

Setting up Renoise

Do the following to make sure everything is set up:

Check CPU frequency governor

$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

If this returns something other than performance, it means CPU frequency scaling is enabled, and should be disabled for Renoise to work properly. More info here: https://wiki.linuxaudio.org/wiki/system_configuration#cpu_frequency_scaling

On Guix System:

I was able to fix this using the following code in my system configuration:

(service tlp-service-type
         (tlp-configuration
          ;; for renoise/music DAW
          (cpu-scaling-governor-on-ac (list "performance"))
          (cpu-scaling-governor-on-bat (list "performance"))
          (energy-perf-policy-on-ac "performance")
          (energy-perf-policy-on-bat "performance")))

If you dont use tlp or dont have a battery power supply on your computer, you shouldn’t blindly copy this code into your configuration.

Check PAM audio configuration

On foreign distros:

Check if either /etc/security/limits.d/audio.conf exists or if running grep -E "^[^#]+(rtprio).*$" /etc/security/limits.conf returns some value. If so, PAM should be installed and configured for realtime audio applications.

On Guix System:

In your operating-system declaration, make sure you have something like:

(groups (cons (user-group (system? #t) (name "realtime"))
              %base-groups))

As well as:

(users (cons*
        (user-account
         (name "nya")
         (comment "Nya")
         (group "users")
         (home-directory "/home/nya")
         (supplementary-groups '("wheel"
                                 "audio" "video"
                                 "netdev"
                                 "kvm" "docker"
                                 "realtime"))) ; add the newly created group to user
        %base-user-accounts))

(note the ~”realtime”~ near the bottom (we created this group with the first code block))

And also:

(service pam-limits-service-type
         (list
          (pam-limits-entry "@realtime" 'both 'rtprio 99)
          ;; 'nice value adjusts priority of audio/video processes...
          ;; (pam-limits-entry "@realtime" 'both 'nice 0)
          (pam-limits-entry "@realtime" 'both 'memlock 'unlimited)))

(this configures PAM for realtime audio applications for users under the realtime group (I think))

Further configuration

You’ll want to set up Jack or pure Alsa to get Renoise to work. If you’re using Pulseaudio, you will either need to do some heavy hacking, or install Pipewire. If you’re using Guix System, the best approach is to set up Guix Home and install the Pipewire home service (you would then launch Renoise with $ pw-jack renoise to provide a Jack interface).

Need help getting Renoise to work on Guix System?

Post an issue and I’ll try to help out. There’s a good chance I’ve faced a similar issue.

Contributing

I’m not extremely savvy with Guix or scheme, so let me know if there are any ways in which I can improve this channel! :3

For example:

  • request to make available certain Renoise versions
  • channel not working!
  • improving package definitions, but especially Renoise’s
    • To fix/implement in Renoise package:
      1. Check CPU frequency governor and PAM audio configuration.
        • in installer.sh, it greps paths like /sys/devices/system/cpu/..., which doesn’t seem to be a path accessible to Guix during package building (or maybe just the install phase perhaps).
      2. Check if the installer version and the package version matches.
        • Brainstorming ideas: maybe in the package definiton, during the install phase, search the file install.sh for string regex ^RENOISE_VERSION=(.*)$ and compare the extracted substring version with the package’s version? I’m not sure how that would be implemented…

References

Notes to self

  • Does not specifying package version to transformation actually break things when the renoise package definition is updated?
  • enable git commit signing: git config –global user.signingKey <gpg –list-keys –keyid-format long> git config –global commit.gpgSign true

About

A personal guix channel

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published