2009-03-07 00:21:31 +01:00
|
|
|
let lib = import ./default.nix; in
|
|
|
|
|
2009-02-09 17:51:03 +01:00
|
|
|
rec {
|
|
|
|
|
|
|
|
|
|
|
|
# Wrapper aroung the primop `addErrorContext', which shouldn't used
|
|
|
|
# directly. It evaluates and returns `val', but if an evaluation
|
|
|
|
# error occurs, the text in `msg' is added to the error context
|
|
|
|
# (stack trace) printed by Nix.
|
|
|
|
addErrorContext =
|
|
|
|
if builtins ? addErrorContext
|
|
|
|
then builtins.addErrorContext
|
|
|
|
else msg: val: val;
|
|
|
|
|
2009-03-07 00:21:31 +01:00
|
|
|
addErrorContextToAttrs = lib.mapAttrs (a : v : lib.addErrorContext "while evaluating ${a}" v);
|
2009-02-09 17:51:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
}
|