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

htop: use attrsOf type instead of attrs as the settings type #5564

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Luflosi
Copy link

@Luflosi Luflosi commented Jun 21, 2024

Description

Read NixOS/nixpkgs#85508 for why it's a bad idea to use the attrs type.
I noticed this problem while trying to use mkDefault for one of the options, which did not work and instead failed with the unhelpful error message error: cannot coerce a set to a string.

The new type is a little more strict than the old type. I could have probably used something like attrsOf anything but making the type a little more explicit seems like a good idea. Let me know if 100% backwards compatibility is more important.

Checklist

  • Change is backwards compatible.

  • Code formatted with ./format.

  • Code tested through nix-shell --pure tests -A run.all or nix develop --ignore-environment .#all using Flakes.

  • Test cases updated/added. See example.

  • Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

    See CONTRIBUTING for more information and recent commit messages for examples.

  • If this PR adds a new module

    • Added myself as module maintainer. See example.

Maintainer CC

@bjpbakker @somasis

Read NixOS/nixpkgs#85508 for why it's a bad idea to use the attrs type.
I noticed this problem while trying to use `mkDefault` for one of the options, which did not work and instead failed with the unhelpful error message `error: cannot coerce a set to a string`.
The new type is a little more strict than the old type. I could have probably used something like `attrsOf anything` but making the type a little more explicit seems like a good idea.
@bjpbakker
Copy link
Contributor

Nice, thanks for the improvement :)

@Luflosi
Copy link
Author

Luflosi commented Jul 2, 2024

Is there anything missing to get this merged? Can I ping anyone?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants