Preheat oven to 350°F (175°C). Grease two 9-inch round cake pans, line the bottoms with parchment paper circles, and lightly flour the sides.
In a large bowl, whisk together flour, baking powder, cinnamon, baking soda, salt, and nutmeg until evenly distributed with no clumps.
In a medium bowl, whisk sugar and oil until well combined. Add eggs one at a time, whisking well after each, then stir in vanilla.
Pour wet ingredients into dry and fold gently with a rubber spatula just until no flour streaks remain. A few small lumps are fine.
Fold in grated carrots, drained pineapple, and optional nuts and coconut until evenly distributed.
Divide batter evenly between prepared pans, smooth tops, and tap pans on the counter. Bake 30-35 minutes until a toothpick comes out clean. Cool in pans 10 minutes, then turn out onto wire racks to cool completely.
Beat softened cream cheese and butter until smooth and fluffy, about 2-3 minutes. Gradually add powdered sugar one cup at a time, then add vanilla and salt. Beat on high 2-3 minutes until light and fluffy.
Place one cooled layer on a serving plate, spread about 1 cup frosting over top. Add second layer, then spread a thin crumb coat over the entire cake. Refrigerate 15 minutes, then apply final frosting layer and garnish as desired.