{
  lib,
  config,
  pkgs,
  ...
}: let
  cfg = config.myConfig.music;
in {
  options.myConfig.music = {
    enable = lib.mkEnableOption "sound system";
  };

  config = lib.mkIf cfg.enable {
    # musnix = {
    #   enable = true;
    #   rtcqs.enable = true;
    #   kernel.realtime = true;
    #   kernel.packages = pkgs.linuxPackages-rt_latest;
    # };
    users.users.max.extraGroups = ["audio"];

    services.pipewire = {
      enable = true;
      alsa.enable = true;
      alsa.support32Bit = true;
      pulse.enable = true;
      jack.enable = true;
      wireplumber.enable = true;
    };
    security.rtkit.enable = true;
  };
}
