Initial commit
This commit is contained in:
44
modules/audio/pipewire.nix
Normal file
44
modules/audio/pipewire.nix
Normal file
@@ -0,0 +1,44 @@
|
||||
{ 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 ];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user