anchor.diff:  with lib;
   
   let
  +  cfg = config.services.logind;
  +
     logindHandlerType = types.enum [
       "ignore" "poweroff" "reboot" "halt" "kexec" "suspend"
       "hibernate" "hybrid-sleep" "suspend-then-hibernate" "lock"
  
positive.code:     environment.etc = {
        "systemd/logind.conf".text = ''
          [Login]
          KillUserProcesses=${if config.services.logind.killUserProcesses then "yes" else "no"}
          HandleLidSwitch=${config.services.logind.lidSwitch}
          HandleLidSwitchDocked=${config.services.logind.lidSwitchDocked}
          HandleLidSwitchExternalPower=${config.services.logind.lidSwitchExternalPower}
          ${config.services.logind.extraConfig}
        '';
      };
  
  
negative.code:     };
  
      services.logind.lidSwitchExternalPower = mkOption {
        default = cfg.lidSwitch;
        defaultText = literalExpression "services.logind.lidSwitch";
        example = "ignore";
        type = logindHandlerType;
  