about summary refs log tree commit diff
path: root/modules/hardware/sound/default.nix
blob: dc9f07928637668df14d5540c10b73eb7345f2e5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{ 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;
  };
}