modules/output: cleanup + refactoring #1889
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
General cleanup and refactoring to the output module, with the goal of streamlining and simplifying the implementation.
For example, the
files
submodule haspath
andplugin
options that are essentially the same asextraFiles
'target
and the top-level'sinitPath
options respectively.As another example, the
content
option is currently read-only, meaning we cannot reflect the entire config file content there when we addneovimConfig.neovimRcContent
to it.Being able to do this also means the common (non top-level) modules can handle writing the config file, reducing the complexity in both the
files
submodule and the top-level output module.As the changes in this PR are fairly broad, I also added some comments and inlined some sections of the top-level output module. IMO this makes it much easier to understand.
Generalising many of these output options allows for other changes like enabling
type="vim"
at the top-level (if users configuretarget="init.vim"
)I did make the
type
option read-only, since it didn't make sense to me for it to default to thetarget
's extension otherwise. But I'm unsure if this is a good change.Draft
This is a draft because it's currently difficult to test; #1878
It also feels kinda broad, maybe it could be split up into smaller PRs? This is difficult since all the changes touch the same code...
I'd still appreciate feedback on the overall direction, style, changes while we wait for buildbot to work again.
pkgs.wrapNeovimUnstable lua support
While nixpkgs added luaRC support recently, I don't think we can take advantage of that for two reasons:
wrapRc
the way we would likeRelated work
It'd be nice to make "standalone" builds less special; I think we can achieve that by adding a
standalonePackage
option, similar tofinalPackage
.I think the "disabling env config" is somewhat unrelated to
wrapRc
, so perhaps that should have its own option?I don't think we need
wrapRc = mkForce true
in the nixos wrapper, other than to ensure/etc
is used instead of~/.config
.Removing "site" from the rtp could also conflict with treesitter (#1855).
Changes when opening PR
path
->target
finalConfig
optioncontent
in top-levelcontent
typelines
hasContent
to helpers libtype
option readOnly