lib: Working with nested attrsets of packages#202517
Draft
roberth wants to merge 4 commits intoNixOS:masterfrom
Draft
lib: Working with nested attrsets of packages#202517roberth wants to merge 4 commits intoNixOS:masterfrom
lib: Working with nested attrsets of packages#202517roberth wants to merge 4 commits intoNixOS:masterfrom
Conversation
lib: Working with nested attrsetslib: Working with nested attrsets of packages
1 task
Why implement a bad function? Basically because the _idea_ exists and we can't kill an idea. The best we can do is catch anyone who tries to use it, and inform them.
This was referenced Jun 1, 2023
ghost
reviewed
Jun 9, 2023
Comment on lines
+135
to
+138
| (listOf str -> str) -> | ||
| (listOf str -> attrs -> bool) -> | ||
| attrs -> | ||
| attrs |
There was a problem hiding this comment.
Suggested change
| (listOf str -> str) -> | |
| (listOf str -> attrs -> bool) -> | |
| attrs -> | |
| attrs | |
| (listOf str -> str) -> # joinPath | |
| (listOf str -> attrs -> bool) -> # upTo | |
| attrs -> | |
| attrs |
| The `recurseForDerivations` attribute gets removed from the returned tree, | ||
| as it does not contain a derivation, or any information that can't be | ||
| recovered from `(attrs.type or null) == "derivation"`. | ||
| */ |
There was a problem hiding this comment.
Suggested change
| */ | |
| This function probably does not interact well with splicing, so if you are using it on an attrset which is exposed in `top-level.nix`, please verify that cross-compilation still works after doing so. | |
| */ |
| NOTE: This function evaluates too much and should usually be avoided. | ||
|
|
||
| Traverses a potentially nested attribute set of derivations and | ||
| non-derivations in approximately the way `nix-build` would. |
There was a problem hiding this comment.
Suggested change
| non-derivations in approximately the way `nix-build` would. | |
| non-derivations in approximately the way `nix-build` would, removing all non-derivation leaves. |
Comment on lines
+144
to
+145
| `joinDerivationsLeafStrictSep <sep> <v>` turns the tree of derivations `<v>` | ||
| into an attribute set of derivations. |
There was a problem hiding this comment.
Suggested change
| `joinDerivationsLeafStrictSep <sep> <v>` turns the tree of derivations `<v>` | |
| into an attribute set of derivations. | |
| `joinDerivationsLeafStrictSep <sep> <v>` deletes all non-derivation leaves from the nested attrset `<v>` and flattens the result. |
13 tasks
12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes
Functions for
TODO
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notes