-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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.types: chore use consistent payload form #363565
Conversation
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.
Looked at it together with @hsjobeki in a call, LGTM with the release notes!
https://github.com/catppuccin/nix/blob/a817009ebfd2cca7f70a77884e5098d0a8c83f8e/modules/lib/default.nix#L133-L137 Fix is: -mergeEnums = a: b: lib.types.enum (a.functor.binOp a.functor.payload b.functor.payload);
+mergeEnums = a: b: lib.types.enum (a.functor.binOp a.functor.payload b.functor.payload).values; |
@PerchunPak Thanks for reaching out, we were thinking of that exact piece of code when discussing this PR! Since
While |
Any reason not to add that to mergeTypes = a: b: a.typeMerge b.functor; |
Oh yeah, good idea |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/breaking-changes-announcement-for-unstable/17574/72 |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/breaking-changes-announcement-for-unstable/17574/73 |
Made a pr for that #364620 |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/use-cases-of-option-type-internals/57317/1 |
Use
attributeSet
forfunctor.payload
consistently. This reduces complexity and allows to move generic logic for payload handling out of the individual types.types.separatedString
types.enum
Are the only ones that don't use attribute sets for their payload.
I'd like to introduce this convention. Maybe we should add a CI check.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.