mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-14 19:24:34 +02:00
treewide: Reformat with nixfmt
This commit is contained in:
parent
c6281260dc
commit
62f32bfc71
459 changed files with 28139 additions and 26377 deletions
|
@ -6,113 +6,213 @@
|
|||
...
|
||||
}:
|
||||
with lib;
|
||||
helpers.neovim-plugin.mkNeovimPlugin config {
|
||||
name = "obsidian";
|
||||
originalName = "obsidian.nvim";
|
||||
defaultPackage = pkgs.vimPlugins.obsidian-nvim;
|
||||
helpers.neovim-plugin.mkNeovimPlugin config {
|
||||
name = "obsidian";
|
||||
originalName = "obsidian.nvim";
|
||||
defaultPackage = pkgs.vimPlugins.obsidian-nvim;
|
||||
|
||||
maintainers = [maintainers.GaetanLepage];
|
||||
maintainers = [ maintainers.GaetanLepage ];
|
||||
|
||||
## DEPRECATIONS
|
||||
# Introduced 2024-03-12
|
||||
# TODO: remove 2024-05-12
|
||||
deprecateExtraOptions = true;
|
||||
optionsRenamedToSettings = [
|
||||
"dir"
|
||||
"logLevel"
|
||||
"notesSubdir"
|
||||
["templates" "subdir"]
|
||||
["templates" "dateFormat"]
|
||||
["templates" "timeFormat"]
|
||||
["templates" "substitutions"]
|
||||
"noteIdFunc"
|
||||
"followUrlFunc"
|
||||
"noteFrontmatterFunc"
|
||||
"disableFrontmatter"
|
||||
["completion" "nvimCmp"]
|
||||
["completion" "minChars"]
|
||||
"mappings"
|
||||
["dailyNotes" "folder"]
|
||||
["dailyNotes" "dateFormat"]
|
||||
["dailyNotes" "aliasFormat"]
|
||||
["dailyNotes" "template"]
|
||||
"useAdvancedUri"
|
||||
"openAppForeground"
|
||||
"sortBy"
|
||||
"sortReversed"
|
||||
"openNotesIn"
|
||||
["ui" "enable"]
|
||||
["ui" "updateDebounce"]
|
||||
["ui" "externalLinkIcon" "char"]
|
||||
["ui" "externalLinkIcon" "hlGroup"]
|
||||
["ui" "referenceText" "hlGroup"]
|
||||
["ui" "highlightText" "hlGroup"]
|
||||
["ui" "tags" "hlGroup"]
|
||||
["ui" "hlGroups"]
|
||||
["attachments" "imgFolder"]
|
||||
["attachments" "imgTextFunc"]
|
||||
"yamlParser"
|
||||
];
|
||||
imports = let
|
||||
basePluginPath = ["plugins" "obsidian"];
|
||||
## DEPRECATIONS
|
||||
# Introduced 2024-03-12
|
||||
# TODO: remove 2024-05-12
|
||||
deprecateExtraOptions = true;
|
||||
optionsRenamedToSettings = [
|
||||
"dir"
|
||||
"logLevel"
|
||||
"notesSubdir"
|
||||
[
|
||||
"templates"
|
||||
"subdir"
|
||||
]
|
||||
[
|
||||
"templates"
|
||||
"dateFormat"
|
||||
]
|
||||
[
|
||||
"templates"
|
||||
"timeFormat"
|
||||
]
|
||||
[
|
||||
"templates"
|
||||
"substitutions"
|
||||
]
|
||||
"noteIdFunc"
|
||||
"followUrlFunc"
|
||||
"noteFrontmatterFunc"
|
||||
"disableFrontmatter"
|
||||
[
|
||||
"completion"
|
||||
"nvimCmp"
|
||||
]
|
||||
[
|
||||
"completion"
|
||||
"minChars"
|
||||
]
|
||||
"mappings"
|
||||
[
|
||||
"dailyNotes"
|
||||
"folder"
|
||||
]
|
||||
[
|
||||
"dailyNotes"
|
||||
"dateFormat"
|
||||
]
|
||||
[
|
||||
"dailyNotes"
|
||||
"aliasFormat"
|
||||
]
|
||||
[
|
||||
"dailyNotes"
|
||||
"template"
|
||||
]
|
||||
"useAdvancedUri"
|
||||
"openAppForeground"
|
||||
"sortBy"
|
||||
"sortReversed"
|
||||
"openNotesIn"
|
||||
[
|
||||
"ui"
|
||||
"enable"
|
||||
]
|
||||
[
|
||||
"ui"
|
||||
"updateDebounce"
|
||||
]
|
||||
[
|
||||
"ui"
|
||||
"externalLinkIcon"
|
||||
"char"
|
||||
]
|
||||
[
|
||||
"ui"
|
||||
"externalLinkIcon"
|
||||
"hlGroup"
|
||||
]
|
||||
[
|
||||
"ui"
|
||||
"referenceText"
|
||||
"hlGroup"
|
||||
]
|
||||
[
|
||||
"ui"
|
||||
"highlightText"
|
||||
"hlGroup"
|
||||
]
|
||||
[
|
||||
"ui"
|
||||
"tags"
|
||||
"hlGroup"
|
||||
]
|
||||
[
|
||||
"ui"
|
||||
"hlGroups"
|
||||
]
|
||||
[
|
||||
"attachments"
|
||||
"imgFolder"
|
||||
]
|
||||
[
|
||||
"attachments"
|
||||
"imgTextFunc"
|
||||
]
|
||||
"yamlParser"
|
||||
];
|
||||
imports =
|
||||
let
|
||||
basePluginPath = [
|
||||
"plugins"
|
||||
"obsidian"
|
||||
];
|
||||
in
|
||||
[
|
||||
(
|
||||
# We have to remove the option here because the user could set old-style camelCase options in each workspaces element.
|
||||
mkRemovedOptionModule (
|
||||
basePluginPath ++ [ "workspaces" ]
|
||||
) "Please use `plugins.obsidian.settings.workspaces` instead."
|
||||
)
|
||||
(mkRenamedOptionModule (basePluginPath ++ [ "finder" ]) (
|
||||
basePluginPath
|
||||
++ [
|
||||
"settings"
|
||||
"picker"
|
||||
"name"
|
||||
]
|
||||
))
|
||||
(
|
||||
# https://github.com/epwalsh/obsidian.nvim/blob/656d9c2c64528839db8b2d9a091843b3c90155a2/CHANGELOG.md?plain=1#L184
|
||||
mkRenamedOptionModule
|
||||
(
|
||||
basePluginPath
|
||||
++ [
|
||||
"completion"
|
||||
"newNotesLocation"
|
||||
]
|
||||
)
|
||||
(
|
||||
basePluginPath
|
||||
++ [
|
||||
"settings"
|
||||
"new_notes_location"
|
||||
]
|
||||
)
|
||||
)
|
||||
(
|
||||
# We have to remove the option here because the user could set old-style camelCase options in each checkbox element.
|
||||
mkRemovedOptionModule (
|
||||
basePluginPath
|
||||
++ [
|
||||
"ui"
|
||||
"checkboxes"
|
||||
]
|
||||
) "Please use `plugins.obsidian.settings.ui.checkboxes` instead."
|
||||
)
|
||||
]
|
||||
++ (map
|
||||
(
|
||||
optionPath:
|
||||
mkRemovedOptionModule (basePluginPath ++ optionPath) "This option was deprecated by upstream."
|
||||
)
|
||||
[
|
||||
( # We have to remove the option here because the user could set old-style camelCase options in each workspaces element.
|
||||
mkRemovedOptionModule
|
||||
(basePluginPath ++ ["workspaces"])
|
||||
"Please use `plugins.obsidian.settings.workspaces` instead."
|
||||
)
|
||||
(
|
||||
mkRenamedOptionModule
|
||||
(basePluginPath ++ ["finder"])
|
||||
(basePluginPath ++ ["settings" "picker" "name"])
|
||||
)
|
||||
(
|
||||
# https://github.com/epwalsh/obsidian.nvim/blob/656d9c2c64528839db8b2d9a091843b3c90155a2/CHANGELOG.md?plain=1#L184
|
||||
mkRenamedOptionModule
|
||||
(basePluginPath ++ ["completion" "newNotesLocation"])
|
||||
(basePluginPath ++ ["settings" "new_notes_location"])
|
||||
)
|
||||
( # We have to remove the option here because the user could set old-style camelCase options in each checkbox element.
|
||||
mkRemovedOptionModule
|
||||
(basePluginPath ++ ["ui" "checkboxes"])
|
||||
"Please use `plugins.obsidian.settings.ui.checkboxes` instead."
|
||||
)
|
||||
]
|
||||
++ (map (
|
||||
optionPath:
|
||||
mkRemovedOptionModule
|
||||
(basePluginPath ++ optionPath)
|
||||
"This option was deprecated by upstream."
|
||||
)
|
||||
[ "detectCwd" ]
|
||||
[ "backlinks" ]
|
||||
[
|
||||
["detectCwd"]
|
||||
["backlinks"]
|
||||
["completion" "prependNoteId"]
|
||||
["completion" "prependNotePath"]
|
||||
["completion" "usePathOnly"]
|
||||
]);
|
||||
"completion"
|
||||
"prependNoteId"
|
||||
]
|
||||
[
|
||||
"completion"
|
||||
"prependNotePath"
|
||||
]
|
||||
[
|
||||
"completion"
|
||||
"usePathOnly"
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
settingsOptions = let
|
||||
opts = import ./options.nix {inherit lib helpers;};
|
||||
settingsOptions =
|
||||
let
|
||||
opts = import ./options.nix { inherit lib helpers; };
|
||||
in
|
||||
{
|
||||
dir = helpers.mkNullOrOption types.str ''
|
||||
Alternatively to `workspaces` - and for backwards compatibility - you can set `dir` to a
|
||||
single path instead of `workspaces`.
|
||||
{
|
||||
dir = helpers.mkNullOrOption types.str ''
|
||||
Alternatively to `workspaces` - and for backwards compatibility - you can set `dir` to a
|
||||
single path instead of `workspaces`.
|
||||
|
||||
For example:
|
||||
```nix
|
||||
dir = "~/vaults/work";
|
||||
```
|
||||
'';
|
||||
For example:
|
||||
```nix
|
||||
dir = "~/vaults/work";
|
||||
```
|
||||
'';
|
||||
|
||||
workspaces =
|
||||
helpers.defaultNullOpts.mkNullable
|
||||
workspaces =
|
||||
helpers.defaultNullOpts.mkNullable
|
||||
(
|
||||
with types;
|
||||
listOf
|
||||
(types.submodule {
|
||||
listOf (
|
||||
types.submodule {
|
||||
options = {
|
||||
name = mkOption {
|
||||
type = with helpers.nixvimTypes; maybeRaw str;
|
||||
|
@ -126,7 +226,8 @@ with lib;
|
|||
|
||||
overrides = opts;
|
||||
};
|
||||
})
|
||||
}
|
||||
)
|
||||
)
|
||||
"[]"
|
||||
''
|
||||
|
@ -137,36 +238,35 @@ with lib;
|
|||
You can also provide configuration overrides for each workspace through the `overrides`
|
||||
field.
|
||||
'';
|
||||
}
|
||||
// opts;
|
||||
|
||||
settingsExample = {
|
||||
workspaces = [
|
||||
{
|
||||
name = "work";
|
||||
path = "~/obsidian/work";
|
||||
}
|
||||
// opts;
|
||||
|
||||
settingsExample = {
|
||||
workspaces = [
|
||||
{
|
||||
name = "work";
|
||||
path = "~/obsidian/work";
|
||||
}
|
||||
{
|
||||
name = "startup";
|
||||
path = "~/obsidian/startup";
|
||||
}
|
||||
];
|
||||
new_notes_location = "current_dir";
|
||||
completion = {
|
||||
nvim_cmp = true;
|
||||
min_chars = 2;
|
||||
};
|
||||
{
|
||||
name = "startup";
|
||||
path = "~/obsidian/startup";
|
||||
}
|
||||
];
|
||||
new_notes_location = "current_dir";
|
||||
completion = {
|
||||
nvim_cmp = true;
|
||||
min_chars = 2;
|
||||
};
|
||||
};
|
||||
|
||||
extraConfig = cfg: {
|
||||
warnings = let
|
||||
extraConfig = cfg: {
|
||||
warnings =
|
||||
let
|
||||
nvimCmpEnabled = isBool cfg.settings.completion.nvim_cmp && cfg.settings.completion.nvim_cmp;
|
||||
in
|
||||
optional
|
||||
(nvimCmpEnabled && !config.plugins.cmp.enable)
|
||||
''
|
||||
Nixvim (plugins.obsidian): You have enabled `completion.nvim_cmp` but `plugins.cmp.enable` is `false`.
|
||||
You should probably enable `nvim-cmp`.
|
||||
'';
|
||||
};
|
||||
}
|
||||
optional (nvimCmpEnabled && !config.plugins.cmp.enable) ''
|
||||
Nixvim (plugins.obsidian): You have enabled `completion.nvim_cmp` but `plugins.cmp.enable` is `false`.
|
||||
You should probably enable `nvim-cmp`.
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue