aboutsummaryrefslogblamecommitdiff
path: root/modules/hardware/sound/default.nix
blob: edb937e4febb75c0791c284da2559b0772e20d31 (plain) (tree)
1
2
3
4

                                   

  













                                                                                   
                 

















                                       
{ config, lib, pkgs, ... }:
let cfg = config.my.hardware.sound;
in
{
  options.my.hardware.sound = with lib; {
    pipewire = { enable = mkEnableOption "pipewire configuration"; };
  };

  config = lib.mkIf cfg.pipewire.enable {
    sound.enable = true;

    # RealtimeKit is recommended
    security.rtkit.enable = true;

    environment.systemPackages = with pkgs; [
      # We install it to get access to pactl. It isn't enabled or run as a service.
      pulseaudio
      pavucontrol
      easyeffects
    ];

    services.pipewire = {
      enable = true;

      alsa = {
        enable = true;
        support32Bit = true;
      };

      pulse = { enable = true; };

      jack = { enable = true; };
    };

    hardware.pulseaudio.enable = false;
  };
}