nix-community.nixvim/plugins/by-name/glow/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

87 lines
2 KiB
Nix
Raw Normal View History

2024-07-07 16:56:24 -04:00
{
lib,
pkgs,
...
}:
2024-09-15 16:05:35 -05:00
let
inherit (lib.nixvim) defaultNullOpts;
in
lib.nixvim.neovim-plugin.mkNeovimPlugin {
2024-07-07 16:56:24 -04:00
name = "glow";
originalName = "glow.nvim";
package = "glow-nvim";
2024-07-07 16:56:24 -04:00
maintainers = [ lib.maintainers.getchoo ];
settingsOptions = {
2024-09-15 16:05:35 -05:00
glow_path = defaultNullOpts.mkStr (lib.nixvim.mkRaw "vim.fn.exepath('glow')") ''
2024-07-07 16:56:24 -04:00
Path to `glow` binary.
If null or `""`, `glow` in your `$PATH` with be used if available.
Using `glowPackage` is the recommended way to make `glow` available in your `$PATH`.
'';
2024-09-15 16:05:35 -05:00
install_path = defaultNullOpts.mkStr "~/.local/bin" ''
2024-07-07 16:56:24 -04:00
Path for installing `glow` binary if one is not found at `glow_path` or in your `$PATH`.
Consider using `glowPackage` instead.
'';
2024-09-15 16:05:35 -05:00
border = defaultNullOpts.mkEnumFirstDefault [
2024-07-07 16:56:24 -04:00
"shadow"
"none"
"double"
"rounded"
"solid"
"single"
] "Style of the floating window's border.";
2024-09-15 16:09:02 -05:00
style = defaultNullOpts.mkNullable (
with lib.types;
either (maybeRaw str) (enum [
"dark"
"light"
])
) (lib.nixvim.mkRaw "vim.opt.background") "Glow style.";
2024-07-07 16:56:24 -04:00
2024-09-15 16:05:35 -05:00
pager = defaultNullOpts.mkBool false ''
2024-07-07 16:56:24 -04:00
Display output in a pager style.
'';
2024-09-15 16:05:35 -05:00
width = defaultNullOpts.mkInt 100 ''
2024-07-07 16:56:24 -04:00
Width of the floating window.
'';
2024-09-15 16:05:35 -05:00
height = defaultNullOpts.mkInt 100 ''
2024-07-07 16:56:24 -04:00
Height of the floating window.
'';
2024-09-15 16:05:35 -05:00
width_ratio = defaultNullOpts.mkNum 0.7 ''
2024-07-07 16:56:24 -04:00
Maximum width of the floating window relative to the window size.
'';
2024-09-15 16:05:35 -05:00
height_ratio = defaultNullOpts.mkNum 0.7 ''
2024-07-07 16:56:24 -04:00
Maximum height of the floating window relative to the window size.
'';
};
settingsExample = {
border = "shadow";
style = "dark";
pager = false;
width = 80;
height = 100;
width_ratio = 0.7;
height_ratio = 0.7;
};
extraOptions = {
glowPackage = lib.mkPackageOption pkgs "glow" {
nullable = true;
2024-07-07 16:56:24 -04:00
};
};
extraConfig = cfg: { extraPackages = [ cfg.glowPackage ]; };
}