···8888 else { ${elemAt attrPath n} = atDepth (n + 1); };
8989 in atDepth 0;
90909191- /* Like `attrByPath', but without a default value. If it doesn't find the
9191+ /* Like `attrByPath`, but without a default value. If it doesn't find the
9292 path it will throw an error.
93939494 Example:
···274274 # The set to get the named attributes from
275275 attrs: genAttrs names (name: attrs.${name});
276276277277- /* Collect each attribute named `attr' from a list of attribute
277277+ /* Collect each attribute named `attr` from a list of attribute
278278 sets. Sets that don't contain the named attribute are ignored.
279279280280 Example:
···357357 ) {} list_of_attrs;
358358359359360360- /* Recursively collect sets that verify a given predicate named `pred'
361361- from the set `attrs'. The recursion is stopped when the predicate is
360360+ /* Recursively collect sets that verify a given predicate named `pred`
361361+ from the set `attrs`. The recursion is stopped when the predicate is
362362 verified.
363363364364 Example:
···439439 listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set)));
440440441441442442- /* Like `mapAttrs', but allows the name of each attribute to be
442442+ /* Like `mapAttrs`, but allows the name of each attribute to be
443443 changed in addition to the value. The applied function should
444444- return both the new name and value as a `nameValuePair'.
444444+ return both the new name and value as a `nameValuePair`.
445445446446 Example:
447447 mapAttrs' (name: value: nameValuePair ("foo_" + name) ("bar-" + value))
···479479 map (name: f name attrs.${name}) (attrNames attrs);
480480481481482482- /* Like `mapAttrs', except that it recursively applies itself to
482482+ /* Like `mapAttrs`, except that it recursively applies itself to
483483 attribute sets. Also, the first argument of the argument
484484 function is a *list* of the names of the containing attributes.
485485···499499 mapAttrsRecursiveCond (as: true) f set;
500500501501502502- /* Like `mapAttrsRecursive', but it takes an additional predicate
502502+ /* Like `mapAttrsRecursive`, but it takes an additional predicate
503503 function that tells it whether to recurse into an attribute
504504- set. If it returns false, `mapAttrsRecursiveCond' does not
504504+ set. If it returns false, `mapAttrsRecursiveCond` does not
505505 recurse, but does apply the map function. If it returns true, it
506506 does recurse, and does not apply the map function.
507507···655655656656 /* Merge sets of attributes and combine each attribute value in to a list.
657657658658- Like `lib.attrsets.zipAttrsWith' with `(name: values: values)' as the function.
658658+ Like `lib.attrsets.zipAttrsWith` with `(name: values: values)` as the function.
659659660660 Example:
661661 zipAttrs [{a = "x";} {a = "y"; b = "z";}]
+11-11
lib/customisation.nix
···33rec {
445566- /* `overrideDerivation drv f' takes a derivation (i.e., the result
77- of a call to the builtin function `derivation') and returns a new
66+ /* `overrideDerivation drv f` takes a derivation (i.e., the result
77+ of a call to the builtin function `derivation`) and returns a new
88 derivation in which the attributes of the original are overridden
99- according to the function `f'. The function `f' is called with
99+ according to the function `f`. The function `f` is called with
1010 the original derivation attributes.
11111212- `overrideDerivation' allows certain "ad-hoc" customisation
1212+ `overrideDerivation` allows certain "ad-hoc" customisation
1313 scenarios (e.g. in ~/.config/nixpkgs/config.nix). For instance,
1414 if you want to "patch" the derivation returned by a package
1515 function in Nixpkgs to build another version than what the
···104104 else result;
105105106106107107- /* Call the package function in the file `fn' with the required
107107+ /* Call the package function in the file `fn` with the required
108108 arguments automatically. The function is called with the
109109- arguments `args', but any missing arguments are obtained from
110110- `autoArgs'. This function is intended to be partially
109109+ arguments `args`, but any missing arguments are obtained from
110110+ `autoArgs`. This function is intended to be partially
111111 parameterised, e.g.,
112112113113 callPackage = callPackageWith pkgs;
···116116 libbar = callPackage ./bar.nix { };
117117 };
118118119119- If the `libbar' function expects an argument named `libfoo', it is
119119+ If the `libbar` function expects an argument named `libfoo`, it is
120120 automatically passed as an argument. Overrides or missing
121121- arguments can be supplied in `args', e.g.
121121+ arguments can be supplied in `args`, e.g.
122122123123 libbar = callPackage ./bar.nix {
124124 libfoo = null;
···255255 in lib.deepSeq drv' drv';
256256257257 /* Make a set of packages with a common scope. All packages called
258258- with the provided `callPackage' will be evaluated with the same
258258+ with the provided `callPackage` will be evaluated with the same
259259 arguments. Any package in the set may depend on any other. The
260260 `overrideScope'` function allows subsequent modification of the package
261261 set in a consistent way, i.e. all packages in the set will be
262262 called with the overridden packages. The package sets may be
263263 hierarchical: the packages in the set are called with the scope
264264- provided by `newScope' and the set provides a `newScope' attribute
264264+ provided by `newScope` and the set provides a `newScope` attribute
265265 which can form the parent scope for later package sets. */
266266 makeScope = newScope: f:
267267 let self = f self // {
+1-1
lib/default.nix
···11/* Library of low-level helper functions for nix expressions.
22 *
33 * Please implement (mostly) exhaustive unit tests
44- * for new functions in `./tests.nix'.
44+ * for new functions in `./tests.nix`.
55 */
66let
77
+3-3
lib/lists.nix
···242242243243 /* Return a singleton list or an empty list, depending on a boolean
244244 value. Useful when building lists with optional elements
245245- (e.g. `++ optional (system == "i686-linux") firefox').
245245+ (e.g. `++ optional (system == "i686-linux") firefox`).
246246247247 Type: optional :: bool -> a -> [a]
248248···283283 */
284284 toList = x: if isList x then x else [x];
285285286286- /* Return a list of integers from `first' up to and including `last'.
286286+ /* Return a list of integers from `first` up to and including `last`.
287287288288 Type: range :: int -> int -> [int]
289289···320320 ) { right = []; wrong = []; });
321321322322 /* Splits the elements of a list into many lists, using the return value of a predicate.
323323- Predicate should return a string which becomes keys of attrset `groupBy' returns.
323323+ Predicate should return a string which becomes keys of attrset `groupBy` returns.
324324325325 `groupBy'` allows to customise the combining function and initial value
326326
+1-1
lib/meta.nix
···2727 setName = name: drv: drv // {inherit name;};
282829293030- /* Like `setName', but takes the previous name as an argument.
3030+ /* Like `setName`, but takes the previous name as an argument.
31313232 Example:
3333 updateName (oldName: oldName + "-experimental") somePkg