-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
nixos/nixpkgs: make nixpkgs.config mergeable
#194207
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| { lib, config, ... }: with lib; { | ||
| options.packageOverrides = mkOption { | ||
| default = const {}; | ||
| type = types.overrideFnType; | ||
| }; | ||
| options.result = mkOption { | ||
| type = types.attrs; | ||
| }; | ||
| config = mkMerge [ | ||
| { | ||
| packageOverrides = pkgs: { | ||
| test = pkgs.num + 1; | ||
| }; | ||
| } | ||
| { | ||
| packageOverrides = pkgs: { | ||
| test2 = pkgs.test + 1; | ||
| }; | ||
| } | ||
| { | ||
| packageOverrides = mkAfter (pkgs: { | ||
| test3 = 1; | ||
| }); | ||
| } | ||
| { | ||
| packageOverrides = pkgs: { | ||
| test3 = 2; | ||
| }; | ||
| } | ||
| { | ||
| result = config.packageOverrides { num = 23; }; | ||
| } | ||
| ]; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -131,10 +131,26 @@ let | |
| checkMeta = mkOption { | ||
| type = types.bool; | ||
| default = false; | ||
| description = '' | ||
| description = lib.mdDoc '' | ||
| Whether to check that the `meta` attribute of derivations are correct during evaluation time. | ||
| ''; | ||
| }; | ||
|
|
||
| packageOverrides = mkOption { | ||
| default = const {}; | ||
| type = types.overrideFnType; | ||
| description = lib.mdDoc '' | ||
| **Not recommended.** Use `overlays` instead! | ||
| ''; | ||
| }; | ||
|
|
||
| perlPackageOverrides = mkOption { | ||
| default = const {}; | ||
| type = types.overrideFnType; | ||
| description = lib.mdDoc '' | ||
| A function that takes the final set of Perl packages and returns an attribute set of packages to add or change. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In addition, the (this shows that the first attribute in the passed
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yikes, but it also kinda makes sense, because how else would you access Anyway, thanks @infinisil for catching this and sorry @Ma27 for making a wrong suggestion.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no worries, I also missed that!
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Uhm... I obseve the same behavior on my local Am I missing something? oO
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's as expected. This just demonstrates that
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It's funny. In a discussion today the inverse came up. Without a way to reference |
||
| ''; | ||
| }; | ||
| }; | ||
|
|
||
| in { | ||
|
|
||
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.
This changes the merging behavior from before. Most notably the old merging function didn't propagate changes from earlier overrides to later ones, there's only one
pkgsthat is reused as the input for all override functions.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 that
functionTo attrsthen?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.
Almost. I think not because of the
optCall, which allows either functions or attribute sets directlyThere 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, then it needs a
coercedTo.optCallcan be replaced bylib.toFunction, but I guess we'll only needlib.constanyway.