nixos-config/modules/hardware/audio.nix

36 lines
931 B
Nix
Raw Normal View History

{ config, options, lib, pkgs, ... }:
with lib;
2020-12-29 14:32:59 +00:00
let cfg = config.modules.hardware.audio;
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;
};
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" ];
};
}