mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 10:21:31 +00:00
feat: apply new module format to note-taking plugins
This commit is contained in:
parent
4434d9e053
commit
d93b005f2c
9 changed files with 181 additions and 134 deletions
32
modules/notes/obsidian/config.nix
Normal file
32
modules/notes/obsidian/config.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with builtins; let
|
||||
cfg = config.vim.notes.obsidian;
|
||||
auto = config.vim.autocomplete;
|
||||
in {
|
||||
config = mkIf (cfg.enable) {
|
||||
vim.startPlugins = [
|
||||
"obsidian-nvim"
|
||||
"vim-markdown"
|
||||
"tabular"
|
||||
];
|
||||
|
||||
vim.luaConfigRC.obsidian = nvim.dag.entryAnywhere ''
|
||||
require("obsidian").setup({
|
||||
dir = "${cfg.dir}",
|
||||
completion = {
|
||||
nvim_cmp = ${
|
||||
if (auto.type == "nvim-cmp")
|
||||
then "true"
|
||||
else "false"
|
||||
}
|
||||
}
|
||||
})
|
||||
'';
|
||||
};
|
||||
}
|
|
@ -1,51 +1,6 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with builtins; let
|
||||
cfg = config.vim.notes.obsidian;
|
||||
auto = config.vim.autocomplete;
|
||||
in {
|
||||
options.vim.notes = {
|
||||
obsidian = {
|
||||
enable = mkEnableOption "Complementary neovim plugins for Obsidian editor";
|
||||
dir = mkOption {
|
||||
type = types.str;
|
||||
default = "~/my-vault";
|
||||
description = "Obsidian vault directory";
|
||||
};
|
||||
|
||||
completion = {
|
||||
nvim_cmp = mkOption {
|
||||
# if using nvim-cmp, otherwise set to false
|
||||
type = types.bool;
|
||||
description = "If using nvim-cmp, otherwise set to false";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf (cfg.enable) {
|
||||
vim.startPlugins = [
|
||||
"obsidian-nvim"
|
||||
"vim-markdown"
|
||||
"tabular"
|
||||
];
|
||||
|
||||
vim.luaConfigRC.obsidian = nvim.dag.entryAnywhere ''
|
||||
require("obsidian").setup({
|
||||
dir = "${cfg.dir}",
|
||||
completion = {
|
||||
nvim_cmp = ${
|
||||
if (auto.type == "nvim-cmp")
|
||||
then "true"
|
||||
else "false"
|
||||
}
|
||||
}
|
||||
})
|
||||
'';
|
||||
};
|
||||
_: {
|
||||
imports = [
|
||||
./obsidian.nix
|
||||
./config.nix
|
||||
];
|
||||
}
|
||||
|
|
30
modules/notes/obsidian/obsidian.nix
Normal file
30
modules/notes/obsidian/obsidian.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with builtins; let
|
||||
cfg = config.vim.notes.obsidian;
|
||||
auto = config.vim.autocomplete;
|
||||
in {
|
||||
options.vim.notes = {
|
||||
obsidian = {
|
||||
enable = mkEnableOption "Complementary neovim plugins for Obsidian editor";
|
||||
dir = mkOption {
|
||||
type = types.str;
|
||||
default = "~/my-vault";
|
||||
description = "Obsidian vault directory";
|
||||
};
|
||||
|
||||
completion = {
|
||||
nvim_cmp = mkOption {
|
||||
# if using nvim-cmp, otherwise set to false
|
||||
type = types.bool;
|
||||
description = "If using nvim-cmp, otherwise set to false";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue