anchor.diff:          type = types.bool;
           default = false;
           description = "Whether to enable the ACPI daemon.";
  +      };
  +
  +      handlers = mkOption {
  +        type = types.attrsOf (types.submodule {
  +          options = {
  +            event = mkOption {
  +              type = types.str;
  +              example = [ "button/power.*" "button/lid.*" "ac_adapter.*" "button/mute.*" "button/volumedown.*" "cd/play.*" "cd/next.*" ];
  +              description = "Event type.";
  +            };
  +
  +            action = mkOption {
  +              type = types.lines;
  +              description = "Shell commands to execute when the event is triggered.";
  +            };
  +          };
  +        });
  +
  +        description = "Event handlers.";
  +        default = {};
  +        example = { mute = { event = "button/mute.*"; action = "amixer set Master toggle"; }; };
  +
  +
         };
   
         powerEventCommands = mkOption {
  
positive.code:         type = types.lines;
          default = "";
          description = "Shell commands to execute on an ac_adapter.* event.";
        };
  
        muteCommands = mkOption {
          type = types.lines;
          default = "";
          description = "Shell commands to execute on an button/mute.* event.";
        };
  
        volumeDownEventCommands = mkOption {
          type = types.lines;
          default = "";
          description = "Shell commands to execute on an button/volumedown.* event.";
        };
  
        volumeUpEventCommands = mkOption {
          type = types.lines;
          default = "";
          description = "Shell commands to execute on an button/volumeup.* event.";
        };
  
        cdPlayEventCommands = mkOption {
          type = types.lines;
          default = "";
          description = "Shell commands to execute on an cd/play.* event.";
        };
  
        cdNextEventCommands = mkOption {
          type = types.lines;
          default = "";
          description = "Shell commands to execute on an cd/next.* event.";
        };
  
        cdPrevEventCommands = mkOption {
          type = types.lines;
          default = "";
          description = "Shell commands to execute on an cd/prev.* event.";
        };
  
      };
  
negative.code: with lib;
  
  let
  
    canonicalHandlers = {
      powerEvent = {
        event = "button/power.*";
        action = config.services.acpid.powerEventCommands;
      };
  
      lidEvent = {
        event = "button/lid.*";
        action = config.services.acpid.lidEventCommands;
      };
  
      acEvent = {
        event = "ac_adapter.*";
        action = config.services.acpid.acEventCommands;
      };
    };
  
    acpiConfDir = pkgs.runCommand "acpi-events" {}
      ''
  