{
  config,
  pkgs,
  lib,
  ...
}: let
  cfg = config.alqueva.system.pipewire;
in {
  options.alqueva.system.pipewire = {
    enable = lib.mkEnableOption "PipeWire";
  };

  config = lib.mkIf cfg.enable {
    security.rtkit.enable = true;
    services.pipewire = {
      enable = true;
      alsa.enable = true;
      jack.enable = true;
      pulse.enable = true;
      wireplumber.enable = true;
    };
    environment.systemPackages = [
      pkgs.pwvucontrol
      pkgs.helvum
    ];
  };
}
