From a01ac0648cce549c8ea4d2741b0f0a7781d1c766 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Mon, 7 Apr 2025 09:27:48 +0200 Subject: [PATCH 01/20] nixos/i18n: lib.filterAttrs -> lib.removeAttrs --- nixos/modules/config/i18n.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/config/i18n.nix b/nixos/modules/config/i18n.nix index 1e6c35a4ea31..60ccc6dcfe55 100644 --- a/nixos/modules/config/i18n.nix +++ b/nixos/modules/config/i18n.nix @@ -12,7 +12,7 @@ let ] ++ lib.pipe config.i18n.extraLocaleSettings [ # See description of extraLocaleSettings for why is this ignored here. - (lib.filterAttrs (n: v: n != "LANGUAGE")) + (x: lib.removeAttrs x [ "LANGUAGE" ]) (lib.mapAttrs (n: v: (sanitizeUTF8Capitalization v))) (lib.mapAttrsToList (LCRole: lang: lang + "/" + (config.i18n.localeCharsets.${LCRole} or "UTF-8"))) ] From e090d24809f42ecb4d3f50f7239352aaa1471321 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Mon, 7 Apr 2025 09:30:31 +0200 Subject: [PATCH 02/20] nixos/thinkfan: lib.filterAttrs -> lib.removeAttrs --- nixos/modules/services/hardware/thinkfan.nix | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/nixos/modules/services/hardware/thinkfan.nix b/nixos/modules/services/hardware/thinkfan.nix index d5d1f23f1d98..daf865252653 100644 --- a/nixos/modules/services/hardware/thinkfan.nix +++ b/nixos/modules/services/hardware/thinkfan.nix @@ -101,14 +101,12 @@ let # removes NixOS special and unused attributes sensorToConf = { type, query, ... }@args: - (lib.filterAttrs ( - k: v: - v != null - && !(lib.elem k [ + (lib.filterAttrs (k: v: v != null) ( + lib.removeAttrs args [ "type" "query" - ]) - ) args) + ] + )) // { "${type}" = query; }; From 5bf55cee1fe411a33d96492abc55c5de3a56fd30 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Mon, 7 Apr 2025 09:33:37 +0200 Subject: [PATCH 03/20] nixos/public-inbox: lib.filterAttrs -> lib.removeAttrs --- nixos/modules/services/mail/public-inbox.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/mail/public-inbox.nix b/nixos/modules/services/mail/public-inbox.nix index 0933d2dd535d..353db2e2207c 100644 --- a/nixos/modules/services/mail/public-inbox.nix +++ b/nixos/modules/services/mail/public-inbox.nix @@ -403,7 +403,7 @@ in } ]; services.public-inbox.settings = filterAttrsRecursive (n: v: v != null) { - publicinbox = mapAttrs (n: filterAttrs (n: v: n != "description")) cfg.inboxes; + publicinbox = mapAttrs (n: v: removeAttrs v [ "description" ]) cfg.inboxes; }; users = { users.public-inbox = { From e3366549da1d62b3d4e516ad3ac9824b7ea05c5c Mon Sep 17 00:00:00 2001 From: h7x4 Date: Mon, 7 Apr 2025 09:36:55 +0200 Subject: [PATCH 04/20] nixos/grafana: lib.filterAttrs -> lib.removeAttrs --- nixos/modules/services/monitoring/grafana.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/monitoring/grafana.nix b/nixos/modules/services/monitoring/grafana.nix index 9aad9e21fa6e..46da20bec8ad 100644 --- a/nixos/modules/services/monitoring/grafana.nix +++ b/nixos/modules/services/monitoring/grafana.nix @@ -126,7 +126,7 @@ let ''; # Get a submodule without any embedded metadata: - _filter = x: filterAttrs (k: v: k != "_module") x; + _filter = x: removeAttrs x [ "_module" ]; # https://grafana.com/docs/grafana/latest/administration/provisioning/#datasources grafanaTypes.datasourceConfig = types.submodule { From 71644ede59a910ebddc207458031faca4e6c1111 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Mon, 7 Apr 2025 09:38:21 +0200 Subject: [PATCH 05/20] nixos/authelia: lib.filterAttrs -> lib.removeAttrs --- nixos/modules/services/security/authelia.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/security/authelia.nix b/nixos/modules/services/security/authelia.nix index 5dc438473a1d..059337e3a425 100644 --- a/nixos/modules/services/security/authelia.nix +++ b/nixos/modules/services/security/authelia.nix @@ -270,7 +270,7 @@ let lib.updateManyAttrsByPath [ { path = lib.init pathList; - update = old: lib.filterAttrs (n: v: n != (lib.last pathList)) old; + update = old: lib.removeAttrs old [ (lib.last pathList) ]; } ] set; in From dbe03e152ce5fb1cabaf59d24cd5f80bd471b018 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Mon, 7 Apr 2025 09:39:41 +0200 Subject: [PATCH 06/20] nixos/prometheus-exporters/mail: lib.filterAttrs -> lib.removeAttrs --- .../modules/services/monitoring/prometheus/exporters/mail.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/monitoring/prometheus/exporters/mail.nix b/nixos/modules/services/monitoring/prometheus/exporters/mail.nix index 7dc40293d464..61ca738fdd31 100644 --- a/nixos/modules/services/monitoring/prometheus/exporters/mail.nix +++ b/nixos/modules/services/monitoring/prometheus/exporters/mail.nix @@ -15,6 +15,7 @@ let nameValuePair toLower filterAttrs + removeAttrs escapeShellArg literalExpression mkIf @@ -41,7 +42,7 @@ let ) else nameValuePair (toLower name) value - ) (filterAttrs (n: _: !(n == "_module")) cfg.configuration) + ) (removeAttrs cfg.configuration [ "_module" ]) ) ); From 77bd06103070b993b5045f9aaf1a01bba9641bf4 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Mon, 7 Apr 2025 09:40:48 +0200 Subject: [PATCH 07/20] nixos/systemd: lib.filterAttrs -> lib.removeAttrs --- nixos/modules/system/boot/systemd.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index c7e81bb44335..3c827c3d6627 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -592,7 +592,7 @@ in ''; enabledUpstreamSystemUnits = filter (n: !elem n cfg.suppressedSystemUnits) upstreamSystemUnits; - enabledUnits = filterAttrs (n: v: !elem n cfg.suppressedSystemUnits) cfg.units; + enabledUnits = removeAttrs cfg.units cfg.suppressedSystemUnits; in { From d857cda9ec0786765a63ae9a67b034439f13542b Mon Sep 17 00:00:00 2001 From: h7x4 Date: Mon, 7 Apr 2025 09:58:24 +0200 Subject: [PATCH 08/20] quartus-prime-lite: lib.filterAttrs -> lib.removeAttrs --- pkgs/by-name/qu/quartus-prime-lite/quartus.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/by-name/qu/quartus-prime-lite/quartus.nix b/pkgs/by-name/qu/quartus-prime-lite/quartus.nix index 2349d765b3cd..68121d1a14ce 100644 --- a/pkgs/by-name/qu/quartus-prime-lite/quartus.nix +++ b/pkgs/by-name/qu/quartus-prime-lite/quartus.nix @@ -35,9 +35,7 @@ let }) supportedDevices ); - unsupportedDeviceIds = lib.filterAttrs ( - name: value: !(lib.hasAttr name supportedDeviceIds) - ) deviceIds; + unsupportedDeviceIds = lib.removeAttrs deviceIds (lib.attrNames supportedDeviceIds); componentHashes = { "arria_lite" = "sha256-ASvi9YX15b4XXabGjkuR5wl9wDwCijl8s750XTR/4XU="; From 82f8caefa346c463f3196fb0cfc6744b4bba0a49 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Mon, 7 Apr 2025 10:03:01 +0200 Subject: [PATCH 09/20] haskell-language-server: lib.filterAttrs -> lib.removeAttrs --- .../tools/haskell/haskell-language-server/withWrapper.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/tools/haskell/haskell-language-server/withWrapper.nix b/pkgs/development/tools/haskell/haskell-language-server/withWrapper.nix index 2beaa3ed8e45..600a1acd6de6 100644 --- a/pkgs/development/tools/haskell/haskell-language-server/withWrapper.nix +++ b/pkgs/development/tools/haskell/haskell-language-server/withWrapper.nix @@ -99,7 +99,7 @@ let let # only formatters that were not requested unwanted = lib.pipe knownFormatters [ - (lib.filterAttrs (fmt: _: !(lib.elem fmt supportedFormatters))) + (fmts: lib.removeAttrs fmts supportedFormatters) lib.attrsToList ]; # all flags to disable From 467464e0cd66e2ef4b37ede14cec56bd360712c7 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Mon, 7 Apr 2025 10:19:21 +0200 Subject: [PATCH 10/20] linux: lib.filterAttrs -> lib.removeAttrs --- pkgs/os-specific/linux/kernel/patches.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/kernel/patches.nix b/pkgs/os-specific/linux/kernel/patches.nix index ddda525e70b0..6719de2e3468 100644 --- a/pkgs/os-specific/linux/kernel/patches.nix +++ b/pkgs/os-specific/linux/kernel/patches.nix @@ -57,7 +57,7 @@ in { name = lib.removeSuffix ".patch" src.name; - patch = fetchurl (lib.filterAttrs (k: v: k != "extra") src); + patch = fetchurl (lib.removeAttrs src [ "extra" ]); extra = src.extra; inherit version sha256; }; From b6625b9f0107efbb2a7f5b030556c5e1c4594ceb Mon Sep 17 00:00:00 2001 From: h7x4 Date: Mon, 7 Apr 2025 12:10:54 +0200 Subject: [PATCH 11/20] stdenv/darwin: lib.filterAttrs -> lib.removeAttrs --- pkgs/stdenv/darwin/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix index 4fa9b5454aed..d7eb0c453ec4 100644 --- a/pkgs/stdenv/darwin/default.nix +++ b/pkgs/stdenv/darwin/default.nix @@ -737,7 +737,10 @@ assert bootstrapTools.passthru.isFromBootstrapFiles or false; # sanity check (disallowedPackages prevStage) # Only cctools and ld64 are rebuilt from `bintoolsPackages` to avoid rebuilding their dependencies # again in this stage after building them in stage 1. - (lib.filterAttrs (name: _: name != "ld64" && name != "cctools") (bintoolsPackages prevStage)) + (lib.removeAttrs (bintoolsPackages prevStage) [ + "ld64" + "cctools" + ]) (llvmToolsDeps prevStage) (sdkPackages prevStage) (sdkPackagesNoCC prevStage) From e029ab783d8151b12b2b7ec58c0001966b276774 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Mon, 8 Sep 2025 21:37:00 +0200 Subject: [PATCH 12/20] python3Packages.pulsar-client: lib.filterAttrs -> lib.removeAttrs --- pkgs/development/python-modules/pulsar-client/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/pulsar-client/default.nix b/pkgs/development/python-modules/pulsar-client/default.nix index 3c9b5303ad7d..2919a84f8e79 100644 --- a/pkgs/development/python-modules/pulsar-client/default.nix +++ b/pkgs/development/python-modules/pulsar-client/default.nix @@ -67,7 +67,7 @@ buildPythonPackage rec { ratelimit ]; avro = [ fastavro ]; - all = lib.flatten (lib.attrValues (lib.filterAttrs (n: v: n != "all") optional-dependencies)); + all = lib.flatten (lib.attrValues (lib.removeAttrs optional-dependencies [ "all" ])); }; nativeCheckInputs = [ From d79a2afea101d3a943662814d7e2cd798955cc2d Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sun, 26 Oct 2025 14:53:38 +0900 Subject: [PATCH 13/20] python3Packages.dramatiq-abort: lib.filterAttrs -> lib.removeAttrs --- pkgs/development/python-modules/dramatiq-abort/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/dramatiq-abort/default.nix b/pkgs/development/python-modules/dramatiq-abort/default.nix index b4130f701bfe..655d2da4ec0f 100644 --- a/pkgs/development/python-modules/dramatiq-abort/default.nix +++ b/pkgs/development/python-modules/dramatiq-abort/default.nix @@ -29,7 +29,7 @@ buildPythonPackage rec { ]; optional-dependencies = { - all = lib.flatten (lib.attrValues (lib.filterAttrs (n: v: n != "all") optional-dependencies)); + all = lib.flatten (lib.attrValues (lib.removeAttrs optional-dependencies [ "all" ])); gevent = [ gevent ]; redis = [ redis ]; }; From 38190d2687fd7c80c9d5351cdcb89c27ab10d00b Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sun, 26 Oct 2025 14:53:48 +0900 Subject: [PATCH 14/20] python3Packages.markdown2: lib.filterAttrs -> lib.removeAttrs --- pkgs/development/python-modules/markdown2/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/markdown2/default.nix b/pkgs/development/python-modules/markdown2/default.nix index d417fb25ca10..e4a6cfd497a0 100644 --- a/pkgs/development/python-modules/markdown2/default.nix +++ b/pkgs/development/python-modules/markdown2/default.nix @@ -34,7 +34,7 @@ buildPythonPackage rec { code_syntax_highlighting = [ pygments ]; wavedrom = [ wavedrom ]; latex = [ latex2mathml ]; - all = lib.flatten (lib.attrValues (lib.filterAttrs (n: v: n != "all") optional-dependencies)); + all = lib.flatten (lib.attrValues (lib.removeAttrs optional-dependencies [ "all" ])); }; meta = { From 4376ce331c691780bb1ad30b6b3a3fc6838eaa68 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sun, 26 Oct 2025 14:53:59 +0900 Subject: [PATCH 15/20] python3Packages.odc-loader: lib.filterAttrs -> lib.removeAttrs --- pkgs/development/python-modules/odc-loader/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/odc-loader/default.nix b/pkgs/development/python-modules/odc-loader/default.nix index e97bb7e87dc6..6fb6f3422ca8 100644 --- a/pkgs/development/python-modules/odc-loader/default.nix +++ b/pkgs/development/python-modules/odc-loader/default.nix @@ -50,7 +50,7 @@ buildPythonPackage rec { optional-dependencies = { botocore = [ botocore ]; zarr = [ zarr ]; - all = lib.flatten (lib.attrValues (lib.filterAttrs (n: v: n != "all") optional-dependencies)); + all = lib.flatten (lib.attrValues (lib.removeAttrs optional-dependencies [ "all" ])); }; nativeCheckInputs = [ From da7a71e82428f037d52f6e9504e42989698294be Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sun, 26 Oct 2025 14:54:07 +0900 Subject: [PATCH 16/20] python3Packages.pettingzoo: lib.filterAttrs -> lib.removeAttrs --- pkgs/development/python-modules/pettingzoo/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/pettingzoo/default.nix b/pkgs/development/python-modules/pettingzoo/default.nix index 1409b29e3633..e8fa3a1ed962 100644 --- a/pkgs/development/python-modules/pettingzoo/default.nix +++ b/pkgs/development/python-modules/pettingzoo/default.nix @@ -53,7 +53,7 @@ buildPythonPackage rec { ]; optional-dependencies = { - all = lib.flatten (lib.attrValues (lib.filterAttrs (n: v: n != "all") optional-dependencies)); + all = lib.flatten (lib.attrValues (lib.removeAttrs optional-dependencies [ "all" ])); atari = [ # multi-agent-ale-py pygame From 1d546cf368572db8c87cc8f0f57ac87162e151ed Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sun, 26 Oct 2025 14:54:18 +0900 Subject: [PATCH 17/20] python3Packages.planetary-computer: lib.filterAttrs -> lib.removeAttrs --- pkgs/development/python-modules/planetary-computer/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/planetary-computer/default.nix b/pkgs/development/python-modules/planetary-computer/default.nix index 7014512b6e4c..7bc6d0d61641 100644 --- a/pkgs/development/python-modules/planetary-computer/default.nix +++ b/pkgs/development/python-modules/planetary-computer/default.nix @@ -55,7 +55,7 @@ buildPythonPackage rec { optional-dependencies = { adlfs = [ adlfs ]; azure = [ azure-storage-blob ]; - all = lib.flatten (lib.attrValues (lib.filterAttrs (n: v: n != "all") optional-dependencies)); + all = lib.flatten (lib.attrValues (lib.removeAttrs optional-dependencies [ "all" ])); }; pythonImportsCheck = [ From e953f0d20fe1a5ceb9d7e307f85f3b6d65ff0c67 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sun, 26 Oct 2025 14:54:28 +0900 Subject: [PATCH 18/20] python3Packages.pyproject-parser: lib.filterAttrs -> lib.removeAttrs --- pkgs/development/python-modules/pyproject-parser/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/pyproject-parser/default.nix b/pkgs/development/python-modules/pyproject-parser/default.nix index f3108c431c3f..95a7a7e4c2c6 100644 --- a/pkgs/development/python-modules/pyproject-parser/default.nix +++ b/pkgs/development/python-modules/pyproject-parser/default.nix @@ -46,7 +46,7 @@ buildPythonPackage rec { ]; optional-dependencies = { - all = lib.flatten (lib.attrValues (lib.filterAttrs (n: v: n != "all") optional-dependencies)); + all = lib.flatten (lib.attrValues (lib.removeAttrs optional-dependencies [ "all" ])); cli = [ click consolekit From d56b377b93807f915c6f6745c179726fe9d53219 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sun, 26 Oct 2025 14:54:38 +0900 Subject: [PATCH 19/20] python3Packages.tianshou: lib.filterAttrs -> lib.removeAttrs --- pkgs/development/python-modules/tianshou/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/tianshou/default.nix b/pkgs/development/python-modules/tianshou/default.nix index 7cb9052c2d02..2012e3f360a9 100644 --- a/pkgs/development/python-modules/tianshou/default.nix +++ b/pkgs/development/python-modules/tianshou/default.nix @@ -92,7 +92,7 @@ buildPythonPackage rec { ]; optional-dependencies = { - all = lib.flatten (lib.attrValues (lib.filterAttrs (n: v: n != "all") optional-dependencies)); + all = lib.flatten (lib.attrValues (lib.removeAttrs optional-dependencies [ "all" ])); argparse = [ docstring-parser From 6952069832f45e58a2a14959af7163a30f3997ee Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sun, 26 Oct 2025 14:54:45 +0900 Subject: [PATCH 20/20] python3Packages.whey: lib.filterAttrs -> lib.removeAttrs --- pkgs/development/python-modules/whey/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/whey/default.nix b/pkgs/development/python-modules/whey/default.nix index ace0f3fbad75..e07c68a3a423 100644 --- a/pkgs/development/python-modules/whey/default.nix +++ b/pkgs/development/python-modules/whey/default.nix @@ -55,7 +55,7 @@ buildPythonPackage rec { pythonImportsCheck = [ "whey" ]; optional-dependencies = { - all = lib.flatten (lib.attrValues (lib.filterAttrs (n: v: n != "all") optional-dependencies)); + all = lib.flatten (lib.attrValues (lib.removeAttrs optional-dependencies [ "all" ])); editable = [ editables ];