[Nix-dev] NixOS module assertions

Marc Weber marco-oweber at gmx.de
Tue Mar 29 18:25:36 CEST 2011


Excerpts from Nicolas Pierron's message of Tue Mar 29 18:09:29 +0200 2011:
> The problem I see here is that you cannot focus on small subset of
> your configuration if one assertion is failing unless you disable each
> module.
> The problem is raised when you may want to check for option values
> while trying to understand why you've got an error message (including
> the assertions).
I don't know what you mean by "check for option values".
The assertion message should be unique. By grepping for it it should be
easy to understand the cause of trouble.
That would be my way to cope with such failures..

Is this the difference:
my solution:
  assertions always fire

your solution:
  assertions only fire when a "guarded" expression is used?

I see the point. However I don't think its important because assertions
are usually guarded by mkIfs or the like. Thus they are only checked
when a module is enabled.

> I would prefer to use properties for assertions (mkAssert), so an
> assertion made on an unused option has no effect.
I already said that I'm fine with your solution.
You know this code much better than I do.

Marc Weber



More information about the nix-dev mailing list