```scala
private[spark] def getSparkHome(): Option[String] = {
  conf.getOption("spark.home").orElse(Option(System.getenv("SPARK_HOME")))
}
```