diff options
Diffstat (limited to 'modules/hardware/sound')
-rw-r--r-- | modules/hardware/sound/default.nix | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/modules/hardware/sound/default.nix b/modules/hardware/sound/default.nix new file mode 100644 index 0000000..95e5ebc --- /dev/null +++ b/modules/hardware/sound/default.nix @@ -0,0 +1,35 @@ +{ 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 + ]; + + services.pipewire = { + enable = true; + + alsa = { + enable = true; + support32Bit = true; + }; + + pulse = { enable = true; }; + + jack = { enable = true; }; + }; + + hardware.pulseaudio.enable = false; + }; +} |