2020-11-02 14:44:48 +00:00
|
|
|
{ config, options, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
2020-12-29 14:32:59 +00:00
|
|
|
let cfg = config.modules.hardware.audio;
|
2020-11-02 14:44:48 +00:00
|
|
|
in {
|
|
|
|
options.modules.hardware.audio = let
|
|
|
|
mkBoolDefault = bool:
|
|
|
|
mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
};
|
2020-12-29 14:32:59 +00:00
|
|
|
in {
|
|
|
|
enable = mkBoolDefault false;
|
|
|
|
jack.enable = mkBoolDefault false;
|
2020-11-02 14:44:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
# Enable JACK for the most serious audio applications.
|
|
|
|
# services.jack = {
|
|
|
|
# jackd.enable = true;
|
|
|
|
# alsa.enable = false;
|
|
|
|
# loopback = { enable = true; };
|
|
|
|
# };
|
|
|
|
|
|
|
|
hardware.pulseaudio.package =
|
|
|
|
pkgs.pulseaudio.override { jackaudioSupport = true; };
|
|
|
|
|
|
|
|
# Required when enabling JACK daemon.
|
|
|
|
# USERADD: When the other users also want to take advantage of the audio systems.
|
|
|
|
my.user.extraGroups = [ "audio" "jackaudio" ];
|
|
|
|
|
|
|
|
# Add the sequencer and the MIDI kernel module.
|
|
|
|
boot.kernelModules = [ "snd-seq" "snd-rawmidi" ];
|
|
|
|
};
|
|
|
|
}
|