mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-21 13:10:33 +00:00
1ac9dcd24d
derivation evaluate inside the tryEval. This catches cases such as aufs2-util, which fails due to an assertion in its dependency aufs2. * Explicitly blacklist "xbursttools" because it gives some evaluation error in cross-OpenSSL. No idea why, probably due to some pass-through attribute. svn path=/nixpkgs/trunk/; revision=23247
26 lines
597 B
Nix
26 lines
597 B
Nix
rec {
|
|
|
|
# Identity function.
|
|
id = x: x;
|
|
|
|
# Constant function.
|
|
const = x: y: x;
|
|
|
|
# Named versions corresponding to some builtin operators.
|
|
concat = x: y: x ++ y;
|
|
or = x: y: x || y;
|
|
and = x: y: x && y;
|
|
mergeAttrs = x: y: x // y;
|
|
|
|
# Take a function and evaluate it with its own returned value.
|
|
fix = f: let result = f result; in result;
|
|
|
|
# Flip the order of the arguments of a binary function.
|
|
flip = f: a: b: f b a;
|
|
|
|
# `seq x y' evaluates x, then returns y. That is, it forces strict
|
|
# evaluation of its first argument.
|
|
seq = x: y: if x == null then y else y;
|
|
|
|
}
|