-
-
Notifications
You must be signed in to change notification settings - Fork 186
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
Conversation
1d9848f
to
d2190bc
Compare
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.
config = lib.mkIf (config.stylix.enable && cfg.enable) { | ||
stylix.targets.nixvim.config = lib.mkMerge [ |
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 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 { |
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.
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.
modules/nixvim/nixvim.nix
Outdated
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: |
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.
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). |
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.
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?
@MattSturgeon |
Updated Pull Request resolving #415