warnOnInstantiate
lib.warnOnInstantiate
Docs pulled from | This Revision | 4 days ago
Wrap a derivation such that instantiating it produces a warning.
All attributes will be wrapped with lib.warn except from .meta, .name,
and .type which are used by nix search, and .outputName which avoids
double warnings with nix-instantiate and nix-build.
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;
}
Noogle detected
Implementation
The following is the current implementation of this function.
warnOnInstantiate =
msg: drv:
let
drvToWrap = removeAttrs drv [
"meta"
"name"
"type"
"outputName"
];
in
drv // mapAttrs (_: lib.warn msg) drvToWrap;