query
On this page

recursiveUpdate

lib.attrsets.recursiveUpdate

Docs pulled from | This Revision | 34 minutes ago


A recursive variant of the update operator ‘//’. The recursion stops when one of the attribute values is not an attribute set, in which case the right hand side value takes precedence over the left hand side value.

Inputs

lhs

Left attribute set of the merge.

rhs

Right attribute set of the merge.

Type

recursiveUpdate :: AttrSet -> AttrSet -> AttrSet

Examples

lib.attrsets.recursiveUpdate usage example

recursiveUpdate {
  boot.loader.grub.enable = true;
  boot.loader.grub.device = "/dev/hda";
} {
  boot.loader.grub.device = "";
}

returns: {
  boot.loader.grub.enable = true;
  boot.loader.grub.device = "";
}

Noogle detected

Aliases

Implementation

The following is the current implementation of this function.

recursiveUpdate =
    lhs:
    rhs:
    recursiveUpdateUntil (path: lhs: rhs: !(isAttrs lhs && isAttrs rhs)) lhs rhs;