{ config, lib, pkgs, ... }: let inherit (lib) mkIf mkOption types; in { options.smayzy.audio.enable = mkOption { type = types.bool; default = false; description = "audio settings"; }; config = mkIf config.smayzy.audio.enable { services.pulseaudio.enable = false; security.rtkit.enable = true; services.pipewire = { enable = true; alsa.enable = true; alsa.support32Bit = true; pulse.enable = true; jack.enable = true; extraConfig.pipewire."92-low-latency" = { "context.properties" = { "default.clock.rate" = 48000; "default.clock.quantum" = 128; "default.clock.min-quantum" = 128; "default.clock.max-quantum" = 128; }; }; }; environment.systemPackages = with pkgs; [ pulseaudioFull ]; }; }