Skip to content

Instantly share code, notes, and snippets.

@dustinlacewell dustinlacewell/sound.nix Secret
Created May 22, 2020

Embed
What would you like to do?
{ config, pkgs, lib, ... }:
with lib;
{
options.mine.workstation.sound.enable = mkEnableOption "workstation.sound";
config = mkIf config.mine.workstation.sound.enable {
sound.enable = true;
hardware = {
pulseaudio = {
enable = true;
package = pkgs.pulseaudioFull.override { jackaudioSupport = true; };
support32Bit = true;
};
};
environment.systemPackages = with pkgs; [
pavucontrol pa_applet qjackctl
];
services.jack = {
jackd.enable = true;
# support ALSA only programs via ALSA JACK PCM plugin
alsa.enable = false;
# support ALSA only programs via loopback device (supports programs like Steam)
loopback = {
enable = true;
# buffering parameters for dmix device to work with ALSA only semi-professional sound programs
dmixConfig = ''
period_size 2048
'';
};
};
users.extraUsers.ldlework.extraGroups = [ "jackaudio" ];
boot.kernelModules = [ "snd-seq" "snd-rawmidi" ];
systemd.user.services.pulseaudio.environment = {
JACK_PROMISCUOUS_SERVER = "jackaudio";
};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.