Open
Labels
featureFeature request or proposal
Description
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 (#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 👍 to issues you find important.
Reacted by Spencer Balogh
Metadata
Metadata
Assignees
Labels
featureFeature request or proposal
Activity
[-]builtins.suppressWarnings builtin[/-][+]`builtins.suppressWarnings` builtin[/+]roberth commentedon May 20, 2026
This builtin would be a bit quirky. Because call-by-need saves various intermediate results, you would be able to
a = builtins.warn "foo" something;x:aas part of asuppressWarningscall, not emitting the warningay:aaHere
yshould have triggered the warning, but didn't because of call-by-need.A crude way to solve this is to create a new evaluator + heap to cut out any sharing, but that risks other side effects (e.g. broken function equality breaking some more). I don't think we'd want to go there.
Ideally you could expose enough information in a way that doesn't trigger the warning?
For example, Nixpkgs has warnOnInstantiate to delay the warning until
outPathor similar is accessed.Maybe something like that could be used in your situation too?
hyperparabolic commentedon Sep 12, 2026
I've been struggling with similar. I run nixos-unstable with zfs, so I iterate all of the kernel packages to find the most recent kernel with zfs support to stay (mostly) pinned to the latest tagged zfs release without twiddling
zfs_*version numbers with every release.I've been getting annoyed with more breaks pushing into my hydra due to getting blocked out of
abort-on-warn, and eventually took the time to dig into this and part of that led me here. I landed on just filtering out thelinux_rpi*packages by filtering on name prefix before evaluating attributes that warn. Similar might help you with the rpi warnings.I'd still love a feature like this, or exceptions on
abort-on-warn.stdenv.hostPlatform.*warnings have been pretty endless for me from upstream flakes.roberth commentedon Sep 15, 2026
As the author, I would recommend to use that as a flag for finding details about warnings and nothing else.
I think you mean making
tryEvalcatch these aborts?The purpose of the flag is to produce a trace, so getting
tryEvalto swallow those traces would make it incapable of serving its original purpose.hyperparabolic commentedon Sep 17, 2026
I know it's not really intended to be used as a linting tool, but it kind of quacks like one.
I like when I can have it enabled. It draws my attention to upcoming deprecations in otherwise automated flows. If the warnings are local I fix them immediately. If it's upstream I tend to disable
abort-on-warnand more issues that would be open PRs waiting for me turn into broken hydra builds waiting for me. Not a huge difference at the end of the day, but I prefer the former. If I could ignore warnings matching a specific string pattern or warning class and attach tracking an issue to that, I'd do that instead.