Skip to content

Instantly share code, notes, and snippets.

@turboMaCk
Last active April 23, 2021 04:02
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save turboMaCk/5f26c312c319dd1566bdef0c497cc03b to your computer and use it in GitHub Desktop.
JACK Audio setup on nixos.
# Apha/Experimental via pipewire
{ config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
qjackctl
pavucontrol
];
services.pipewire = {
enable = true;
alsa = {
enable = true;
support32Bit = true;
};
pulse.enable = true;
jack.enable = true;
};
hardware.pulseaudio.enable = false;
}
{ config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
pavucontrol
jack_capture
qjackctl
];
services.jack = {
jackd = {
enable = true;
# To obtain a valid device argument run `aplay -l`
# - `hw` prefix should be always there
# - `1` is a card number
# - `0` is a device number
# Example (card 1, device 0)
# card 1: USB [Scarlett 2i2 USB], device 0: USB Audio [USB Audio]
# Subdevices: 0/1
# Subdevice #0: subdevice #0
extraOptions = [ "-dalsa" "--device" "hw:1,0" ];
package = pkgs.jack2Full;
};
};
hardware.pulseaudio = {
enable = true;
package = pkgs.pulseaudioFull;
extraModules = [ pkgs.pulseaudio-modules-bt ];
support32Bit = true;
};
# NOTE: not needed with musnix which takes care of this implicitely
security.pam.loginLimits = [
{ domain = "@audio"; item = "memlock"; type = "-"; value = "unlimited"; }
{ domain = "@audio"; item = "rtprio"; type = "-"; value = "99"; }
{ domain = "@audio"; item = "nofile"; type = "soft"; value = "99999"; }
{ domain = "@audio"; item = "nofile"; type = "hard"; value = "99999"; }
];
}
@heyarne
Copy link

heyarne commented Mar 29, 2021

Thanks for this gist! I'm trying to set up pipewire as described here on NixOS 20.09 but having some trouble, described here. Maybe you can help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment