Skip to content

lib/attrsets: add filterAttrsRecursiveCond function#141934

Open
r-burns wants to merge 1 commit intoNixOS:masterfrom
r-burns:filter-attrs-recursive-cond
Open

lib/attrsets: add filterAttrsRecursiveCond function#141934
r-burns wants to merge 1 commit intoNixOS:masterfrom
r-burns:filter-attrs-recursive-cond

Conversation

@r-burns
Copy link
Contributor

@r-burns r-burns commented Oct 17, 2021

based on the mapAttrsRecursive{,Cond} functions

Motivation for this change
Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • 21.11 Release Notes (or backporting 21.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Oct 17, 2021
@roberth
Copy link
Member

roberth commented Oct 17, 2021

Please add tests to lib/tests/misc.nix

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 19, 2022
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Mar 20, 2024
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 20, 2024
@wegank wegank force-pushed the filter-attrs-recursive-cond branch from 2188f32 to d1389b1 Compare April 17, 2024 16:39
@github-actions github-actions bot added the 6.topic: lib The Nixpkgs function library label Apr 17, 2024
@ofborg ofborg bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. and removed 2.status: merge conflict This PR has merge conflicts with the target branch 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Apr 17, 2024
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jul 4, 2024
@wegank wegank added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jan 1, 2025
@wolfgangwalther wolfgangwalther force-pushed the filter-attrs-recursive-cond branch from d1389b1 to edf00bf Compare August 31, 2025 19:51
based on the mapAttrsRecursive{,Cond} functions
@wolfgangwalther wolfgangwalther force-pushed the filter-attrs-recursive-cond branch from edf00bf to 7cc1b04 Compare August 31, 2025 19:52
@wolfgangwalther
Copy link
Contributor

I took the liberty to rebase this PR on latest master. No other changes.

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. and removed 2.status: merge conflict This PR has merge conflicts with the target branch 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md labels Aug 31, 2025
@nix-owners nix-owners bot requested a review from hsjobeki August 31, 2025 19:58
Copy link
Member

@roberth roberth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please forgive my short review which is just an extension of my earlier comment. I hope it helps. Otherwise, as it's been a while, if you do not wish to work on this, you can say so and let anyone else hopefully complete it.

This PR certainly needs tests, and the documentation could be improved, just as the standard for docs is improving.
For both, I'd like to refer to #395160

@r-burns
Copy link
Contributor Author

r-burns commented Aug 31, 2025

Thanks, yeah it's been so long since I opened this that to be honest I don't remember what I was going to use it for 😅

I think the principle of this function is correct, so I'll just leave it up in case someone else finds it useful and wants to take over. Feel free to mark as draft, close, push, etc.

@nixpkgs-ci nixpkgs-ci bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: lib The Nixpkgs function library 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

5 participants