nixpkgs/system
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
..
activate-configuration.nix Fix activation script's merge function. 2009-02-22 23:33:58 +00:00
assertion.nix adding assertion support to modular-nixos 2009-04-28 23:05:03 +00:00
fonts.nix Merge system/fontdir.nix and system/fonts.nix into a new configuration file. 2009-01-02 16:07:39 +00:00
i18n.nix Convert "kbd" (i18n) 2009-03-06 12:25:38 +00:00
ids.nix Add Upstart job for PulseAudio as a system-wide daemon. 2009-02-22 16:07:42 +00:00
kernel.nix * Synced with trunk @ 14801 2009-04-08 14:01:16 +00:00
modprobe * Use the aggregator to combine the kernel modules tree with 2008-01-12 23:37:17 +00:00
nixos-environment.nix Remove useless require attribute in system/nixos-environment.nix. 2009-04-12 14:38:41 +00:00
nixos-installer.nix Convert "installer" 2009-03-06 12:25:53 +00:00
nixos-security.nix Convert "nixos security options" 2009-03-06 12:25:46 +00:00
options.nix adding assertion support to modular-nixos 2009-04-28 23:05:03 +00:00
sudo.nix Extra sudo configuration file from: 2009-01-02 16:07:15 +00:00
switch-to-configuration.sh * Synced with trunk @ 15312 2009-04-28 13:38:22 +00:00
system-options.nix doh. my typo while merging 2009-04-28 14:01:11 +00:00
system.nix * Synced with trunk @ 15312 2009-04-28 13:38:22 +00:00
system.sh * Synced with trunk @ 15312 2009-04-28 13:38:22 +00:00
unix-odbc-drivers.nix Convert "unix-odbc-drivers" 2009-03-06 12:25:33 +00:00
users-groups.nix use cat again to create users instead of << "..." 2009-03-06 12:26:16 +00:00