This allows the type's return value to be accessed more easily.
Motivating use case:
- Built-in module provides CLI functionality by declaring
an `attrListWith { asAttrs = true; }`, extracting the ordered list
from `valueMeta` for the purpose of creating the `argv`.
- User modules can read the command line's flags directly without
having to parse the list of attrs.
This adds a type for name-value mappings that preserve ordering.
Motivating use case: command line flags for package modules /
wrappers / modular services.
The option value can be transformed into a command line in the
correct order.
Additionally, a convenience readOnly option could be provided
to give easy introspection access to the values in an ad hoc
manner.
Seems preferable to iterating over a two-element list.
licenseType.exception is only used by lib.licenses.WITH, which I don't
see any usage of in tree - but thought I might as well.
Fold the 'all' attribute into the listToAttrs call alongside the outputs, so commonAttrs builds from drv // listToAttrs(...) // passthru // { drvPath; outPath; } instead of four separate merges with a standalone 'all' attrset.
Also convert remaining optionalAttrs to nullable attr names in extendDerivation, overrideDerivation, and makeOverridable.
Per-derivation // merges drop from 4 to 3.
Meaningful if these functions are partially applied. Saves 16% primops,
12% thunks, and 6% memory bytes when recursively importing all the nix
files in nixpkgs. Slightly increases memory usage when partial function
application isn't done, but I think the benefits outweigh the losses
here.
If these functions are called with partial function application (like
`lib.hasPrefix ".nix"`), then we can avoid performing the isPath check
multiple times, and only confirm it once. This gives 12% less primops
when recursively importing all nix files in nixpkgs.