query
On this page

warnOnInstantiate

lib.warnOnInstantiate

Docs pulled from | This Revision | 10 minutes ago


Wrap a derivation such that instantiating it produces a warning.

All attributes apart from meta, name, and type (which are used by nix search) will be wrapped in lib.warn.

Inputs

msg
The warning message to emit (via lib.warn).
drv
The derivation to wrap.

Examples

lib.derivations.warnOnInstantiate usage example

{
  myPackage = warnOnInstantiate "myPackage has been renamed to my-package" my-package;
}
(lib.derivations.warnOnInstantiate)

Noogle detected

Aliases

Implementation

The following is the current implementation of this function.

warnOnInstantiate =
    msg: drv:
    let
      drvToWrap = removeAttrs drv [
        "meta"
        "name"
        "type"
      ];
    in
    drv // mapAttrs (_: lib.warn msg) drvToWrap;