Pour olive oil into the bottom of a slow cooker. Layer onion slices over the oil. Add green chile peppers, mustard seeds, cumin seeds, sugar, garlic, salt, and pepper. Layer potatoes on top, seasoning each layer with a sprinkle of salt and red pepper flakes.
Cook on High until potatoes are tender, 3 1/2 to 4 hours. Stir gently before serving.