{
  config,
  lib,
  pkgs,
  ...
}:
with lib; let
  cfg = config.local.sys.audio;
in {
  options.local.sys.audio = {
    enable = mkEnableOption "audio settings";
  };
  config = mkIf cfg.enable {
    security.rtkit.enable = true;

    services.pipewire = {
      enable = true;

      alsa = {
        enable = true;
        support32Bit = true;
      };

      jack.enable = true;
      pulse.enable = true;
      wireplumber.enable = true;
    };
  };
}
