summaryrefslogtreecommitdiffstats
path: root/modules/plugins/notes/orgmode/orgmode.nix
blob: 13de3118b485b2e12d00e2433f49cda1dd924b46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{
  config,
  lib,
  pkgs,
  ...
}: let
  inherit (lib.modules) mkRenamedOptionModule;
  inherit (lib.options) mkEnableOption mkOption;
  inherit (lib.types) str listOf;
  inherit (lib.nvim.types) mkTreesitterGrammarOption mkPluginSetupOption;
in {
  imports = [
    (mkRenamedOptionModule ["vim" "notes" "orgmode" "orgAgendaFiles"] ["vim" "notes" "orgmode" "setupOpts" "org_agenda_files"])
    (mkRenamedOptionModule ["vim" "notes" "orgmode" "orgDefaultNotesFile"] ["vim" "notes" "orgmode" "setupOpts" "org_default_notes_file"])
  ];

  options.vim.notes.orgmode = {
    enable = mkEnableOption "nvim-orgmode: Neovim plugin for Emacs Orgmode. Get the best of both worlds";

    setupOpts = mkPluginSetupOption "Orgmode" {
      org_agenda_files = mkOption {
        type = listOf str;
        default = ["~/Documents/org/*" "~/my-orgs/**/*"];
        description = "List of org files to be used as agenda files.";
      };

      org_default_notes_file = mkOption {
        type = str;
        default = "~/Documents/org/refile.org";
        description = "Default org file to be used for notes.";
      };
    };

    treesitter = {
      enable = mkEnableOption "Orgmode treesitter" // {default = config.vim.languages.enableTreesitter;};
      orgPackage = mkTreesitterGrammarOption pkgs "org";
    };
  };
}