From 39d8f52f0e120a693e16bb9fecc30e048694305f Mon Sep 17 00:00:00 2001 From: LilleAila Date: Fri, 17 Jan 2025 21:08:34 +0100 Subject: [PATCH] mini/sessions: init --- docs/release-notes/rl-0.8.md | 1 + flake.lock | 17 +++++++++++++++++ flake.nix | 5 +++++ modules/plugins/mini/default.nix | 1 + modules/plugins/mini/sessions/config.nix | 19 +++++++++++++++++++ modules/plugins/mini/sessions/default.nix | 6 ++++++ modules/plugins/mini/sessions/sessions.nix | 13 +++++++++++++ 7 files changed, 62 insertions(+) create mode 100644 modules/plugins/mini/sessions/config.nix create mode 100644 modules/plugins/mini/sessions/default.nix create mode 100644 modules/plugins/mini/sessions/sessions.nix diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index 800720f6..51947a42 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -84,6 +84,7 @@ - `mini.operators` - `mini.pairs` - `mini.pick` + - `mini.sessions` [kaktu5](https://github.com/kaktu5): diff --git a/flake.lock b/flake.lock index 51932306..5060c260 100644 --- a/flake.lock +++ b/flake.lock @@ -1416,6 +1416,22 @@ "type": "github" } }, + "plugin-mini-sessions": { + "flake": false, + "locked": { + "lastModified": 1735582250, + "narHash": "sha256-vyn8MGyOWFgJ5QVvjYb7K1cKDtg9qWnWYMNf80+kpHk=", + "owner": "echasnovski", + "repo": "mini.sessions", + "rev": "71c9ae596664ac110560d27eb928fc24e22bc53d", + "type": "github" + }, + "original": { + "owner": "echasnovski", + "repo": "mini.sessions", + "type": "github" + } + }, "plugin-minimap-vim": { "flake": false, "locked": { @@ -2642,6 +2658,7 @@ "plugin-mini-operators": "plugin-mini-operators", "plugin-mini-pairs": "plugin-mini-pairs", "plugin-mini-pick": "plugin-mini-pick", + "plugin-mini-sessions": "plugin-mini-sessions", "plugin-minimap-vim": "plugin-minimap-vim", "plugin-modes-nvim": "plugin-modes-nvim", "plugin-neo-tree-nvim": "plugin-neo-tree-nvim", diff --git a/flake.nix b/flake.nix index f6fec140..abc6edbf 100644 --- a/flake.nix +++ b/flake.nix @@ -895,5 +895,10 @@ url = "github:echasnovski/mini.pick"; flake = false; }; + + plugin-mini-sessions = { + url = "github:echasnovski/mini.sessions"; + flake = false; + }; }; } diff --git a/modules/plugins/mini/default.nix b/modules/plugins/mini/default.nix index 97607284..0a7be1af 100644 --- a/modules/plugins/mini/default.nix +++ b/modules/plugins/mini/default.nix @@ -30,5 +30,6 @@ ./operators ./pairs ./pick + ./sessions ]; } diff --git a/modules/plugins/mini/sessions/config.nix b/modules/plugins/mini/sessions/config.nix new file mode 100644 index 00000000..233d6b06 --- /dev/null +++ b/modules/plugins/mini/sessions/config.nix @@ -0,0 +1,19 @@ +{ + config, + lib, + ... +}: let + inherit (lib.modules) mkIf; + inherit (lib.nvim.dag) entryAnywhere; + inherit (lib.nvim.lua) toLuaObject; + + cfg = config.vim.mini.sessions; +in { + vim = mkIf cfg.enable { + startPlugins = ["mini-sessions"]; + + pluginRC.mini-sessions = entryAnywhere '' + require("mini.sessions").setup(${toLuaObject cfg.setupOpts}) + ''; + }; +} diff --git a/modules/plugins/mini/sessions/default.nix b/modules/plugins/mini/sessions/default.nix new file mode 100644 index 00000000..6de787e7 --- /dev/null +++ b/modules/plugins/mini/sessions/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./sessions.nix + ./config.nix + ]; +} diff --git a/modules/plugins/mini/sessions/sessions.nix b/modules/plugins/mini/sessions/sessions.nix new file mode 100644 index 00000000..9a3737d6 --- /dev/null +++ b/modules/plugins/mini/sessions/sessions.nix @@ -0,0 +1,13 @@ +{ + config, + lib, + ... +}: let + inherit (lib.options) mkEnableOption mkOption; + inherit (lib.nvim.types) mkPluginSetupOption; +in { + options.vim.mini.sessions = { + enable = mkEnableOption "mini.sessions"; + setupOpts = mkPluginSetupOption "mini.sessions" {}; + }; +}