That’s not possible for students. They have to sign codes of conduct that include waiving the right to not consent.
Legally, a minor cannot be required to consent to waiving any of their rights, especially not by a school district. They can refuse to consent to the search. They might be subject to school discipline for the refusal (detention, suspension, etc.) but it would take the police getting a warrant to force compliance.