Is there a way to suppress warnings?
I just realized that I could build a local copy of the nixpkgs manual (and then add a command to open it to my systemPackages
) instead of wasting time and bandwidth loading it over the internet every time:
(writeShellScriptBin "nixpkgs-manual" ''
OPEN=$(command -v xdg-open || command -v open)
"$OPEN" "${callPackage "${pkgs.path}/doc" { }}/share/doc/nixpkgs/manual.html"
'')
It seems to work! However, I get a bundle of new warnings when I build:
trace: warning: lib.cartesianProductOfSets is a deprecated alias of lib.cartesianProduct.
trace: warning: lib.zip is a deprecated alias of lib.zipAttrsWith.
trace: warning: lib.zipWithNames is a deprecated alias of lib.zipAttrsWithNames.
trace: warning: lib.strings.isCoercibleToString is deprecated in favor of either isStringLike or isConvertibleWithToString. Only use the latter if it needs to return true for null, numbers, booleans and list of similarl
y coercibles.
trace: warning: lib.readPathsFromFile is deprecated, use a list instead.
trace: warning: lib.replaceChars is a deprecated alias of lib.replaceStrings.
trace: warning: lib.nixpkgsVersion is a deprecated alias of lib.version.
trace: warning: lib.crossLists is deprecated, use lib.mapCartesianProduct instead.
For example, the following function call:
nix-repl> lib.crossLists (x: y: x+y) [[1 2] [3 4]]
[ 4 5 5 6 ]
Can now be replaced by the following one:
nix-repl> lib.mapCartesianProduct ({x,y}: x+y) { x = [1 2]; y = [3 4]; }
[ 4 5 5 6 ]
trace: warning: lib.literalExample is deprecated, use lib.literalExpression instead, or use lib.literalMD for a non-Nix description.
trace: warning: mkPackageOptionMD is deprecated and will be removed in 25.05; please use mkPackageOption.
trace: warning: lib.sources.pathIsDirectory has been moved to lib.filesystem.pathIsDirectory.
trace: warning: lib.sources.pathIsRegularFile has been moved to lib.filesystem.pathIsRegularFile.
trace: warning: lib.sources.pathType has been moved to lib.filesystem.pathType.
These are the same warnings I get when just building the docs as a standalone build.
Is there any way for me to silence these warnings, so they’re not in my face every time I rebuild my system?