runIf :: Bool → Effect → AttrSet

Make an effect conditional, but make always make sure it is buildable.

If the boolean condition evaluates to true, return a run attribute containing the effect, so that it will be executed.

If the boolean condition is false, return a dependencies attribute to make sure the effect’s dependencies are buildable.

Regardless of the condition, return a prebuilt attribute if it is present on the effect.

effect attributes
{ staging = runIf true (/* …​ */); } shown in the dashboard

See also