- Use `lib.mkAssert condition message value` or `assert condition; value` to fail evaluation early with a descriptive message when inputs are invalid.
- Use `lib.warn "message" value` for deprecation warnings that do not abort evaluation — prefer `lib.warnIf condition message value` to make warnings conditional.
- Use strict option types in NixOS modules (`lib.types.str`, `lib.types.port`, `lib.types.enum ["a" "b"]`) so type errors surface at module evaluation time rather than at activation.
- Use `lib.throwIfNot condition message` in library functions to provide actionable error messages instead of Nix's default cryptic attribute-not-found errors.