Résumé : Several problems in power systems can be formulated as consensus problems, including current/power sharing in DC microgrids and input allocation in swing equations. To address these problems, we propose a new passivity concept named Krasovskii passivity. We show that DC microgrids with buck converters and AC microgrids modeled by swing equations possess Krasovskii passivity. Moreover, the aforementioned problems can be formulated within the framework of output/input/power consensus of Krasovskii passive networks under constant disturbances representing power demand. For each problem, we provide simple distributed controllers that do not rely on any system parameters.