From b9c51260d0620ffb0ef59d09b85d1f9d7b979b8c Mon Sep 17 00:00:00 2001 From: Ivan Trubach Date: Wed, 24 Jul 2024 13:01:58 +0300 Subject: [PATCH] lib/deprecated: print deprecation warning for mapAttrsFlatten --- lib/deprecated/misc.nix | 4 ++-- nixos/doc/manual/release-notes/rl-2411.section.md | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/deprecated/misc.nix b/lib/deprecated/misc.nix index 0209dba43406..34d1c01ce811 100644 --- a/lib/deprecated/misc.nix +++ b/lib/deprecated/misc.nix @@ -29,6 +29,7 @@ let nameValuePair tail toList + warn ; inherit (lib.attrsets) removeAttrs mapAttrsToList; @@ -212,8 +213,7 @@ let else closePropagationSlow; # calls a function (f attr value ) for each record item. returns a list - # Renamed to lib.attrsets.mapAttrsToList. - mapAttrsFlatten = mapAttrsToList; + mapAttrsFlatten = warn "lib.misc.mapAttrsFlatten is deprecated, please use lib.attrsets.mapAttrsToList instead." mapAttrsToList; # attribute set containing one attribute nvs = name: value: listToAttrs [ (nameValuePair name value) ]; diff --git a/nixos/doc/manual/release-notes/rl-2411.section.md b/nixos/doc/manual/release-notes/rl-2411.section.md index 96cc4301851d..cd51118dd160 100644 --- a/nixos/doc/manual/release-notes/rl-2411.section.md +++ b/nixos/doc/manual/release-notes/rl-2411.section.md @@ -240,6 +240,8 @@ - [`lib.options.mkPackageOptionMD`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.options.mkPackageOptionMD) is now obsolete; use the identical [`lib.options.mkPackageOption`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.options.mkPackageOption) instead. +- `lib.misc.mapAttrsFlatten` is now formally deprecated and will be removed in future releases; use the identical [`lib.attrsets.mapAttrsToList`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.attrsets.mapAttrsToList) instead. + - `nixosTests` now provide a working IPv6 setup for VLAN 1 by default. - To facilitate dependency injection, the `imgui` package now builds a static archive using vcpkg' CMake rules.