45 lines
952 B
Nix
45 lines
952 B
Nix
{ config, pkgs, lib, ... }:
|
|
let
|
|
cfg = config.my.audio.pipewire;
|
|
in
|
|
{
|
|
options.my.audio.pipewire = {
|
|
support32Bit = lib.mkOption {
|
|
type = lib.types.bool;
|
|
default = true;
|
|
description = "Enable 32-bit ALSA support (useful for some games/apps).";
|
|
};
|
|
|
|
tools = lib.mkOption {
|
|
type = lib.types.enum [ "none" "basic" "full" ];
|
|
default = "basic";
|
|
description = "Install common audio tools.";
|
|
};
|
|
};
|
|
|
|
config = {
|
|
security.rtkit.enable = true;
|
|
|
|
services.pipewire = {
|
|
enable = true;
|
|
wireplumber.enable = true;
|
|
|
|
alsa = {
|
|
enable = true;
|
|
support32Bit = cfg.support32Bit;
|
|
};
|
|
|
|
pulse.enable = true;
|
|
jack.enable = true;
|
|
};
|
|
|
|
environment.systemPackages =
|
|
if cfg.tools == "none" then
|
|
[ ]
|
|
else if cfg.tools == "basic" then
|
|
with pkgs; [ pavucontrol ]
|
|
else
|
|
with pkgs; [ pavucontrol pulsemixer helvum ];
|
|
};
|
|
}
|