-
-
Notifications
You must be signed in to change notification settings - Fork 330
treewide: migrate to lib.mkPackageOption
#2150
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
Conversation
fd9927e
to
0687d36
Compare
This comment was marked as outdated.
This comment was marked as outdated.
c98df19
to
ade6d69
Compare
d30fcbc
to
c86a7e5
Compare
lib.mkPackageOption
lib.mkPackageOption
c86a7e5
to
e630e9d
Compare
e630e9d
to
1732879
Compare
Looks like the assertion is triggering on something. Does it need to be removed from lib/helpers? |
Yeah, this is the issue: nixvim/tests/test-sources/extended-lib.nix Lines 10 to 13 in cdb2e79
3ae7415 resolves it. |
`mkPackageOption` and `mkPluginPackageOption` have both been replaced with nixpkg's `lib.mkPackageOption`.
The test ensures "package" options use a "literalExpression" in their defaultText; i.e. it validates `lib.mkPackageOption` was used to build the package options. All options whose `default` is a derivation are covered by the test, other than submodule sub-options.
3ae7415
to
e48da94
Compare
Interesting... I would have thought it was this because we removed their definitions but it's trying to inherit those options. Or do they still need to be inherited to support the assertion? lib/helpers.nix inherit (helpers.options)
defaultNullOpts
mkCompositeOption
mkCompositeOption'
mkNullOrLua
mkNullOrLua'
mkNullOrLuaFn
mkNullOrLuaFn'
mkNullOrOption
mkNullOrOption'
mkNullOrStr
mkNullOrStr'
mkNullOrStrLuaFnOr
mkNullOrStrLuaFnOr'
mkNullOrStrLuaOr
mkNullOrStrLuaOr'
mkPackageOption
mkPluginPackageOption
mkSettingsOption
pluginDefaultText
; |
Attr values are lazy, so inheriting doesn't actually evaluate the value unless you actually use the inherited value somewhere. The whole point of the But because I was using |
That makes sense, everything looks good to me, then. |
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.
LGTM, thanks for doing this!
@Mergifyio queue |
✅ The pull request has been merged automaticallyThe pull request has been merged automatically at e48da94 |
Adds a test that ensures "package" options use a "literalExpression" in their defaultText; i.e. it validates
lib.mkPackageOption
was used to build the package options.All options whose
default
is a derivation are covered by the test, other than submodule sub-options.This PR completely removes
lib.nixvim.mkPackageOption
andlib.nixvim.mkPluginPackageOption
in favour of usinglib.mkPackageOption
treewide.Example build log produced by the test _without_ the other fixes
lib.mkPackageOption
#2139mkPackageOption
and/ordefaultText
#2160