summaryrefslogtreecommitdiff
path: root/modules/nixos/desktop/audio.nix
blob: 63616875a023d72742a92277ac52bb3274821efd (plain)
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
{ config, lib, ... }:
let
  cfg = config.desktop.audio;
in
{
  options.desktop.audio = {
    enable = lib.mkEnableOption "desktop audio configuration" // {
      default = config.desktop.enable;
      defaultText = lib.literalExpression "config.desktop.enable";
    };
  };

  config = lib.mkIf cfg.enable {
    # we only want pipewire
    hardware.pulseaudio.enable = false;

    # this is recommended for both, though
    security.rtkit.enable = true;

    services = {
      pipewire = lib.mkDefault {
        enable = true;
        wireplumber.enable = true;
        alsa.enable = true;
        jack.enable = true;
        pulse.enable = true;
      };
    };
  };
}