-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
treewide: use lib.optionalAttrs instead of 'then {}' #235924
Conversation
pkgs/development/lisp-modules-obsolete/quicklisp-to-nix-overrides.nix
Outdated
Show resolved
Hide resolved
e851ffa
to
69e8228
Compare
69e8228
to
bc0cf62
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
bc0cf62
to
ed3b102
Compare
thanks for your good and thorough reviews 👍 |
Aaand again - broke evaluation and is blocking channels.
|
@@ -4,8 +4,7 @@ let | |||
skipBuildPhase = x: { | |||
overrides = y: ((x.overrides y) // { buildPhase = "true"; }); | |||
}; | |||
multiOverride = l: x: if l == [] then {} else | |||
((builtins.head l) x) // (multiOverride (builtins.tail l) x); | |||
multiOverride = l: x: pkgs.lib.optionalAttrs (l != []) ((builtins.head l) x) // (multiOverride (builtins.tail l) x); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think missing parentheses here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in #237631
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK I guess, though I really suspect that that if-then-else version was more readable. Also supported by getting several +1 reviews without noticing that the new code parses wrong. (copied this from chat, for reference)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly relevant to the proposal for <|
in NixOS/rfcs#148.
Description of changes
Things done
sandbox = true
set 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/
)