anchor.diff:  
   let
     cfg = config.services.buildkite-agent;
  +
  +  mkHookOption = { name, description, example ? null }: {
  +    inherit name;
  +    value = mkOption {
  +      default = null;
  +      inherit description;
  +      type = types.nullOr types.lines;
  +    } // (if example == null then {} else { inherit example; });
  +  };
  +  mkHookOptions = hooks: listToAttrs (map mkHookOption hooks);
  +
  +  hooksDir = let
  +    mkHookEntry = name: value: ''
  +      cat > $out/${name} <<EOF
  +      #! ${pkgs.stdenv.shell}
  +      set -e
  +      ${value}
  +      EOF
  +      chmod 755 $out/${name}
  +    '';
  +  in pkgs.runCommand "buildkite-agent-hooks" {} ''
  +    mkdir $out
  +    ${concatStringsSep "\n" (mapAttrsToList mkHookEntry (filterAttrs (n: v: v != null) cfg.hooks))}
  +  '';
  +
   in
   
   {
  
positive.code:             '';
            };
          };
      };
    };
  
  
negative.code:             TimeoutSec = 10;
            };
        };
  
      assertions = [
        { assertion = cfg.hooksPath == hooksDir || all isNull (attrValues cfg.hooks);
          message = ''
            Options `services.buildkite-agent.hooksPath' and
            `services.buildkite-agent.hooks.<name>' are mutually exclusive.
          '';
        }
      ];
    };
    imports = [
      (mkRenamedOptionModule [ "services" "buildkite-agent" "token" ]                [ "services" "buildkite-agent" "tokenPath" ])
  