Error handling: Difference between revisions
imported>Pogobanane mNo edit summary |
imported>Carschandler m The previous example for config.warnings was returning a list inside of a list, which doesn't work properly |
||
Line 8: | Line 8: | ||
lib.warn "This is a sample warning message." | lib.warn "This is a sample warning message." | ||
{ | { | ||
config.warnings = | config.warnings = ( | ||
# Some NixOS module: throw error, if services.foo.bar == true | # Some NixOS module: throw error, if services.foo.bar == true | ||
lib.optionals config.services.foo.bar "This is also a sample warning message, but invoked differently." | |||
); | |||
} | } | ||
</syntaxHighlight> | </syntaxHighlight> |