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

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