anchor.diff: -{pkgs, config, ...}:
  +{ config, pkgs, ... }:
   
  -###### interface
  -let
  -  inherit (pkgs.lib) mkOption mkIf;
  -
  -  options = {
  -    powerManagement = {
  -
  -      enable = mkOption {
  -        default = false;
  -        description = "Whether to enable power management (ACPI daemon)";
  -      };
  -    };
  -  };
  -in
  -
  -###### implementation
  +with pkgs.lib;
   
   let
   
  
positive.code:       action = 
          ''
            #! ${pkgs.bash}/bin/sh
  
            if grep -q "state:.*on-line" /proc/acpi/ac_adapter/AC/state; then
               echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
            elif grep -q "state:.*off-line" /proc/acpi/ac_adapter/AC/state; then
               echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
            fi
          '';
      };
  
    events = [powerEvent lidEvent acEvent];
  
  in
  
  mkIf config.powerManagement.enable {
    require = [
      options
    ];
  
    services = {
      extraJobs = [{
        name = "acpid";
  
        job = ''
          description "ACPI daemon"
  
          start on udev
          stop on shutdown
  
          respawn ${pkgs.acpid}/sbin/acpid --foreground --confdir ${acpiConfDir}
        '';
      }];
    };
  }
  
negative.code:       action =
          ''
            #! ${pkgs.bash}/bin/sh
          '';
      };
    
  