`builtins.suppressWarnings` builtin
Author: Pandapip1Created May 13, 2026Updated Sep 17, 2026
Labelsfeature
Is your feature request related to a problem?
I have the following flake: https://codeberg.org/Pandapip1/nixos-linux-rt. It automatically walks through all the nixpkgs kernels and creates PREEMPT_RT variants of them. However, because some filtering is necessary, I have to evaluate all of the entries, which triggers warnings:
evaluation warning: linux-rpi series will be removed in a future release. Please change to use nixos-hardware.
evaluation warning: linux-rpi series will be removed in a future release. Please change to use nixos-hardware.
evaluation warning: linux-rpi series will be removed in a future release. Please change to use nixos-hardware.
evaluation warning: linux-rpi series will be removed in a future release. Please change to use nixos-hardware.Proposed solution
A builtin builtins.suppressWarnings that operates similarly to builtins.tryEval, except it suppresses warnings instead of eval errors.
Alternative solutions
The filtering code is as follows:
upstreamKernels = pkgs.linuxKernel.kernels;
safeKernels = lib.filterAttrs (_: isSafeKernel) upstreamKernels;
rtKernels = lib.mapAttrs (_: mkRtKernel) safeKernels;If builtins.filterAttrs existed (https://github.com/NixOS/nix/issues/11888), then safeKernels would not require the evaluation of the entirety of upstreamKernels, and I wouldn't have to deal with these warnings.
Additional context
N.A.
Checklist
- checked latest Nix manual (source)
- checked open feature issues and pull requests for possible duplicates
Add :+1: to issues you find important.
Source: NixOS/nix