mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-11-07 17:15:58 +01:00
feat: apply new module format to terminal plugins
This commit is contained in:
parent
848fc5f57c
commit
cbf1490308
4 changed files with 31 additions and 15 deletions
|
@ -1,5 +1,5 @@
|
||||||
_: {
|
_: {
|
||||||
imports = [
|
imports = [
|
||||||
./toggleterm.nix
|
./toggleterm
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,20 +8,6 @@ with lib;
|
||||||
with builtins; let
|
with builtins; let
|
||||||
cfg = config.vim.terminal.toggleterm;
|
cfg = config.vim.terminal.toggleterm;
|
||||||
in {
|
in {
|
||||||
options.vim.terminal.toggleterm = {
|
|
||||||
enable = mkEnableOption "Enable toggleterm as a replacement to built-in terminal command";
|
|
||||||
direction = mkOption {
|
|
||||||
type = types.enum ["horizontal" "vertical" "tab" "float"];
|
|
||||||
default = "float";
|
|
||||||
description = "Direction of the terminal";
|
|
||||||
};
|
|
||||||
enable_winbar = mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
description = "Enable winbar";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
vim.startPlugins = [
|
vim.startPlugins = [
|
||||||
"toggleterm-nvim"
|
"toggleterm-nvim"
|
6
modules/terminal/toggleterm/default.nix
Normal file
6
modules/terminal/toggleterm/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
_: {
|
||||||
|
imports = [
|
||||||
|
./toggleterm.nix
|
||||||
|
./config.nix
|
||||||
|
];
|
||||||
|
}
|
24
modules/terminal/toggleterm/toggleterm.nix
Normal file
24
modules/terminal/toggleterm/toggleterm.nix
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib;
|
||||||
|
with builtins; let
|
||||||
|
cfg = config.vim.terminal.toggleterm;
|
||||||
|
in {
|
||||||
|
options.vim.terminal.toggleterm = {
|
||||||
|
enable = mkEnableOption "Enable toggleterm as a replacement to built-in terminal command";
|
||||||
|
direction = mkOption {
|
||||||
|
type = types.enum ["horizontal" "vertical" "tab" "float"];
|
||||||
|
default = "horizontal";
|
||||||
|
description = "Direction of the terminal";
|
||||||
|
};
|
||||||
|
enable_winbar = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Enable winbar";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue