Keep position information for option declarations and definitions

Also, when an option definition fails to type-check, print the file
name of the module in which the offending definition occurs, e.g.

  error: user-thrown exception: The option value `boot.loader.grub.version' in `/etc/nixos/configuration.nix' is not a integer.
This commit is contained in:
Eelco Dolstra
2013-10-28 22:45:55 +01:00
parent cfab329437
commit 40913958a2
3 changed files with 86 additions and 43 deletions
+5
View File
@@ -118,6 +118,11 @@ in rec {
all = pred: fold (x: y: if pred x then y else false) true;
# Count how many times function `pred' returns true for the elements
# of `list'.
count = pred: fold (x: c: if pred x then inc c else c) 0;
# Return a singleton list or an empty list, depending on a boolean
# value. Useful when building lists with optional elements
# (e.g. `++ optional (system == "i686-linux") flashplayer').