Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/maintainers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,10 @@
githubId = 38228372;
name = "Katie Janzen";
};
samos667 = {
email = "sammyetur11@gmail.com";
github = "samos667";
githubId = 50653464;
name = "samos667";
};
}
3 changes: 3 additions & 0 deletions plugins/by-name/molten/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,12 @@ mkVimPlugin {
[
"none"
"image.nvim"
"wezterm"
]
''
How images are displayed.

If set to `"wezterm"`, `plugins.wezterm.enable` must be true.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why not adding a warning to check this ? This is usually what we do.

'';

open_cmd = helpers.mkNullOrOption types.str ''
Expand Down
39 changes: 39 additions & 0 deletions plugins/by-name/wezterm/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
lib,
pkgs,
...
}:
let
inherit (lib.nixvim) defaultNullOpts;
in
lib.nixvim.neovim-plugin.mkNeovimPlugin {
name = "wezterm";
originalName = "wezterm.nvim";
package = "wezterm-nvim";

maintainers = [ lib.maintainers.samos667 ];

extraOptions = {
weztermPackage = lib.mkPackageOption pkgs "wezterm" {
nullable = true;
default = null;
example = [ "wezterm" ];
};
Comment on lines +17 to +21
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What's the best default here? The package or null?

I'm assuming most users who enable this plugin will already have wezterm installed 🤔

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Usually we set the package.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This would achieve that:

Suggested change
weztermPackage = lib.mkPackageOption pkgs "wezterm" {
nullable = true;
default = null;
example = [ "wezterm" ];
};
weztermPackage = lib.mkPackageOption pkgs "wezterm" {
nullable = true;
};

Is there any reason not to do that here?

};

settingsOptions = {
create_commands = defaultNullOpts.mkBool true ''
Whether to create plugin commands.
'';
};

settingsExample = {
create_commands = false;
};

extraConfig = cfg: {
extraPackages = [
cfg.weztermPackage
];
};
}
23 changes: 23 additions & 0 deletions tests/test-sources/plugins/by-name/wezterm/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
empty =
{ pkgs, ... }:
{
plugins.wezterm = {
enable = true;
weztermPackage = pkgs.wezterm;
};
};

defaults =
{ pkgs, ... }:
{
plugins.wezterm = {
enable = true;
weztermPackage = pkgs.wezterm;

settings = {
create_commands = true;
};
};
};
}