senkowo / guix-channel

A personal guix channel
GNU General Public License v3.0
0 stars 0 forks source link

+title: 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:

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

+begin_src scheme

(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)

+end_src

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

Homepage: https://www.renoise.com

Package definition: [[file:yumi/packages/renoise.scm][./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@= renoise@~

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:

*** Using Scheme

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

+begin_src scheme

(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")))

+end_src

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 ~.

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

+begin_src scheme

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

+end_src

**** 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:

+begin_src scheme

(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")))

+end_src

This will provide a package called =renoise-full= that has the transformations applied to it already. It's important to specify =renoise@= 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@= --root= renoise@~

This will create a symlink at ==, 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@= --root= renoise-full@~ (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

+begin_src sh

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

+end_src

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:

+begin_src scheme

(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")))

+end_src

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:

+begin_src scheme

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

+end_src

As well as:

+begin_src scheme

(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))

+end_src

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

And also:

+begin_src scheme

(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)))

+end_src

(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.

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: