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
lib: implement setPrio
#50561
lib: implement setPrio
#50561
Conversation
lib/meta.nix
Outdated
*/ | ||
mapDerivationAttrset = f: set: lib.mapAttrs (name: pkg: if lib.isDerivation pkg then (f pkg) else pkg) set; | ||
|
||
/* Set the nix-env priority of the package. | ||
*/ | ||
setPrio = priority: drv: addMetaAttrs { inherit priority; } drv; |
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.
is this not basically the same as?
addMetaAttrs { priority = 10; } drv;
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 this is a no-op readability change; do you think exposing implementation is better?
(for example, if there are other frequent meta
overrides, improving visibility of addMetaAttrs
could be indeed useful)
For when `hiPrio` and `lowPrio` are not enough.
I think this is a no-op readability change; do you think exposing implementation is better?
Well, to me it just seems strange to expose just two particular priority values out of the whole range.
I do use `setPrio` in my config to influence the priority of the manual pages.
(for example, if there are other frequent `meta` overrides, improving visibility of `addMetaAttrs` could be indeed useful)
I don't think I use any others, though.
|
ping? |
For when
hiPrio
andlowPrio
are not enough.