Go to file
Marc Weber d804730382 adding assertion support to modular-nixos
problem: the nix language assert function can't be used because
of the fix-style used in modular-nixos. A minimal stripped down version
illustrating the problem looks like this:

fix (x : assert x.cfg.foo; { upstartJob = ...; cfg = ...; } )

Now nix has to evaluate x.cfg.foo in order to check the assertion.
However to do so it has to access x.cfg.foo beeing defined in the body
The body can only be evaluated after the assertion passes.
So in the end you get an infinite recursion error.

pierron mentioned that adding another mkIf like function could
work. Maybe this implementation is even simpler. It adds
another option collecting assertions only.
The evaluation is forced by a function adding an empty list to
extraPackages. extraPackages is evaluated by nixos in all cases.
If there are assertions evaluating to false all assertion messages are
presented to the user using throw.

svn path=/nixos/branches/modular-nixos/; revision=15387
2009-04-28 23:05:03 +00:00
boot * Synced with trunk @ 14801 2009-04-08 14:01:16 +00:00
doc * Synced with trunk @ 14801 2009-04-08 14:01:16 +00:00
etc * Synced with trunk @ 15340 2009-04-28 13:42:43 +00:00
helpers * Synced with trunk @ 14801 2009-04-08 14:01:16 +00:00
installer * Synced with trunk @ 15274 2009-04-28 13:34:47 +00:00
system adding assertion support to modular-nixos 2009-04-28 23:05:03 +00:00
test * Add a small script to ensure that all configurations in doc/config-examples can be evaluated. 2009-02-22 23:34:03 +00:00
upstart-jobs * Synced with trunk @ 15348 2009-04-28 13:53:04 +00:00
default.nix * Synced with trunk @ 14801 2009-04-08 14:01:16 +00:00
README * URL updates. 2008-05-09 15:08:43 +00:00
release.nix * Synced with trunk @ 14801 2009-04-08 14:01:16 +00:00
STABLE * Version number, stable marker. 2006-11-04 11:27:08 +00:00
VERSION * Version number, stable marker. 2006-11-04 11:27:08 +00:00

*** NixOS ***

NixOS is a Linux distribution based on the purely functional package
management system Nix.  More information can be found at
http://nixos.org/nixos and in the manual in doc/manual.