-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve listOrDagOf #2124
Comments
I hacked something together: dagEntriesLinear = namePrefix: entries:
let
makeEntry = i: v: let
newVal = {
data = v;
before = [];
after = if i == 0 then [] else ["${namePrefix}.${toString (i - 1)}"];
};
in
lib.nameValuePair "${namePrefix}.${toString i}" newVal;
in
lib.trivial.pipe entries [
(lib.lists.imap0 makeEntry)
lib.listToAttrs
]; |
Thank you for your contribution! I marked this issue as stale due to inactivity. If this remains inactive for another 7 days, I will close this issue. Please read the relevant sections below before commenting. If you are the original author of the issue
If you are not the original author of the issue
Memorandum on closing issuesIf you have nothing of substance to add, please refrain from commenting and allow the bot close the issue. Also, don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen--nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort. |
Still relevant to me. |
Thank you for your contribution! I marked this issue as stale due to inactivity. If this remains inactive for another 7 days, I will close this issue. Please read the relevant sections below before commenting. If you are the original author of the issue
If you are not the original author of the issue
Memorandum on closing issuesIf you have nothing of substance to add, please refrain from commenting and allow the bot close the issue. Also, don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen--nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort. |
As per the helper function posted above, I consider this issue resolved. I'd appreciate if somebody took the time to turn this into a PR though. |
Issue description
Context #1164 #1151 NixOS/nixpkgs#1800
The current solution may work in the sense that it provides a possibility to have a partial order on attributes. However, it leads to very poor user experience when many entries need to be linearly ordered: manually creating that order as of now leads to a lot of boilerplate and reduced maintainability of the code:
Potential ideas for improvement (both general and specific to the SSH module, where the problem is the most prominent):
extraConfig
, which is what thenixpkgs
module does anyways.Meta
CC @rycee @mweinelt
Technical details
"x86_64-linux"
Linux 5.12.10-arch1-1, Arch Linux, noversion
no
yes
nix-env (Nix) 2.3.10
"nixpkgs-21.05.993.93963c27b93, nixpkgs-unstable-21.11pre295670.189a1368878"
~/.nix-defexpr/channels/nixpkgs
The text was updated successfully, but these errors were encountered: