From f8a46d68a7913e568b873c80dc2748c6f3584a95 Mon Sep 17 00:00:00 2001 From: AmanSe Date: Thu, 20 Jul 2023 22:19:27 +0530 Subject: [PATCH] feat: add daily note options for obsidian --- modules/notes/obsidian/config.nix | 12 ++++++++++++ modules/notes/obsidian/obsidian.nix | 13 +++++++++++++ 2 files changed, 25 insertions(+) diff --git a/modules/notes/obsidian/config.nix b/modules/notes/obsidian/config.nix index 1107c35..8f9c2d1 100644 --- a/modules/notes/obsidian/config.nix +++ b/modules/notes/obsidian/config.nix @@ -23,6 +23,18 @@ in { if (auto.type == "nvim-cmp") then "true" else "false" + } + }, + daily_notes = { + folder = ${ + if (cfg.daily-notes.folder == "") + then "nil," + else "'${cfg.daily-notes.folder}'," + } + date_format = ${ + if (cfg.daily-notes.date-format == "") + then "nil," + else "'${cfg.daily-notes.date-format}'," } } }) diff --git a/modules/notes/obsidian/obsidian.nix b/modules/notes/obsidian/obsidian.nix index 674c66b..60ee71f 100644 --- a/modules/notes/obsidian/obsidian.nix +++ b/modules/notes/obsidian/obsidian.nix @@ -14,6 +14,19 @@ with builtins; { description = "Obsidian vault directory"; }; + daily-notes = { + folder = mkOption { + type = types.str; + default = ""; + description = "Directory in which daily notes should be created"; + }; + date-format = mkOption { + type = types.str; + default = ""; + description = "Date format used for creating daily notes"; + }; + }; + completion = { nvim_cmp = mkOption { # if using nvim-cmp, otherwise set to false