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

nixvim: support standalone config as read-only option #795

Closed
wants to merge 2 commits into from

Conversation

jasper-clarke
Copy link

Updated Pull Request resolving #415

  • Add new config option which can be passed into nixvim's extend function.

Copy link

@MattSturgeon MattSturgeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this!

As it stands, there's currently very little difference to #415, especially if 4498af4 is dropped from that PR.

Some minor comments below:

Comment on lines +86 to +87
config = lib.mkIf (config.stylix.enable && cfg.enable) {
stylix.targets.nixvim.config = lib.mkMerge [

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This option def shouldn't need to be conditional.

Rather, only the programs definition below should be conditional.

For comparison, my impl looks like:

config = {
  programs = lib.mkIf (config.stylix.enable && cfg.enable) (
    lib.optionalAttrs (options.programs ? nixvim) {
      nixvim = config.lib.stylix.nixvim.config;
    }
  );
  lib.stylix.nixvim.config = lib.mkMerge [

@@ -22,6 +22,26 @@ in
main = lib.mkEnableOption "background transparency for the main NeoVim window";
signColumn = lib.mkEnableOption "background transparency for the NeoVim sign column";
};
config = lib.mkOption {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In #415, the consensus seemed to be that we should assign the nixvim config to config.lib.stylix.nixvim.config.

Doing that is incompatible with declaring an option, though. So it would be more difficult to document.

Comment on lines 30 to 34
The stylix configuration, generated for nixvim.
If nixvim is installed via nixos, darwin, or home-manager then this will be **automatically**
assigned to `programs.nixvim`. If you're using a "standalone" build of nixvim, then that's
not possible. Instead, you should pass this config to the `nixvimExtend` function.
For example:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The stylix configuration, generated for nixvim.
If nixvim is installed via nixos, darwin, or home-manager then this will be **automatically**
assigned to `programs.nixvim`. If you're using a "standalone" build of nixvim, then that's
not possible. Instead, you should pass this config to the `nixvimExtend` function.
For example:
The stylix configuration, generated for nixvim.
If nixvim is installed via nixos, darwin, or home-manager then this will be **automatically**
assigned to `programs.nixvim`. If you're using a "standalone" build of nixvim, then that's
not possible. Instead, you should pass this config to the `nixvimExtend` function.
For example:

Markdown requires blank lines to signify paragraph breaks.

];
}
```
See nixvim's docs on [extending a standalone configuration](https://nix-community.github.io/nixvim/platforms/standalone.html?highlight=extend#extending-an-existing-configuration).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
See nixvim's docs on [extending a standalone configuration](https://nix-community.github.io/nixvim/platforms/standalone.html?highlight=extend#extending-an-existing-configuration).
See nixvim's docs on [extending a standalone configuration](https://nix-community.github.io/nixvim/platforms/standalone.html#extending-an-existing-configuration).

Probably better without the highlight?

@jasper-clarke
Copy link
Author

@MattSturgeon
Thanks for the review, if your commits have caught up to master then I don't see a reason for me to continue this PR.
I was mostly doing this in the assumption that you had ceased work on the pull request.

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.

2 participants