Skip to content
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

Merged
merged 1 commit into from Jan 18, 2019
Merged

lib: implement setPrio #50561

merged 1 commit into from Jan 18, 2019

Conversation

oxij
Copy link
Member

@oxij oxij commented Nov 18, 2018

For when hiPrio and lowPrio are not enough.

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;
Copy link
Member

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;

Copy link
Member

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.
@oxij
Copy link
Member Author

oxij commented Nov 22, 2018 via email

@oxij
Copy link
Member Author

oxij commented Jan 17, 2019

ping?

@7c6f434c 7c6f434c merged commit 4d0e1b7 into NixOS:master Jan 18, 2019
@oxij oxij deleted the lib/setPrio branch August 12, 2023 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants