diff --git a/extra.nix b/extra.nix index 1c4e661b..2d543ef7 100644 --- a/extra.nix +++ b/extra.nix @@ -140,6 +140,7 @@ inputs: let colorizer.enable = true; icon-picker.enable = true; venn-nvim.enable = false; # FIXME throws an error when its commands are ran manually + diffview-nvim.enable = true; }; vim.notes = { diff --git a/flake.lock b/flake.lock index 974ba4c3..937b391c 100644 --- a/flake.lock +++ b/flake.lock @@ -272,6 +272,22 @@ "type": "github" } }, + "diffview-nvim": { + "flake": false, + "locked": { + "lastModified": 1677593773, + "narHash": "sha256-CMURShXn0RjZW3dc96o1usaLwWC+gOPAkIn3D9YPyBg=", + "owner": "sindrets", + "repo": "diffview.nvim", + "rev": "009beb8054e510e7e2df122ee3ddb2b46bef542b", + "type": "github" + }, + "original": { + "owner": "sindrets", + "repo": "diffview.nvim", + "type": "github" + } + }, "dirt-samples-src": { "flake": false, "locked": { @@ -1235,6 +1251,7 @@ "copilot-lua": "copilot-lua", "crates-nvim": "crates-nvim", "dashboard-nvim": "dashboard-nvim", + "diffview-nvim": "diffview-nvim", "dressing-nvim": "dressing-nvim", "fidget-nvim": "fidget-nvim", "flake-parts": "flake-parts", diff --git a/flake.nix b/flake.nix index 7736d8a9..b5c9120c 100644 --- a/flake.nix +++ b/flake.nix @@ -345,6 +345,11 @@ flake = false; }; + diffview-nvim = { + url = "github:sindrets/diffview.nvim"; + flake = false; + }; + venn-nvim = { url = "github:jbyuki/venn.nvim"; flake = false; diff --git a/lib/types-plugin.nix b/lib/types-plugin.nix index 7e863f8f..aa060f4d 100644 --- a/lib/types-plugin.nix +++ b/lib/types-plugin.nix @@ -70,6 +70,7 @@ with lib; let "kommentary" "mind-nvim" "fidget-nvim" + "diffview-nvim" ]; # You can either use the name of the plugin or a package. pluginsType = with types; listOf (nullOr (either (enum availablePlugins) package)); diff --git a/modules/utility/default.nix b/modules/utility/default.nix index 347e4d7b..f2f0e2fa 100644 --- a/modules/utility/default.nix +++ b/modules/utility/default.nix @@ -7,5 +7,6 @@ _: { ./icon-picker ./telescope ./venn + ./diffview ]; } diff --git a/modules/utility/diffview/config.nix b/modules/utility/diffview/config.nix new file mode 100644 index 00000000..6b81ee41 --- /dev/null +++ b/modules/utility/diffview/config.nix @@ -0,0 +1,21 @@ +{ + pkgs, + config, + lib, + ... +}: +with lib; +with builtins; let + cfg = config.vim.utility.diffview-nvim; +in { + config = mkIf (cfg.enable) { + vim.startPlugins = [ + "diffview-nvim" + "plenary-nvim" + ]; + + vim.luaConfigRC.diffview-nvim = + nvim.dag.entryAnywhere '' + ''; + }; +} diff --git a/modules/utility/diffview/default.nix b/modules/utility/diffview/default.nix new file mode 100644 index 00000000..4cb468b4 --- /dev/null +++ b/modules/utility/diffview/default.nix @@ -0,0 +1,6 @@ +_: { + imports = [ + ./config.nix + ./diffview.nix + ]; +} diff --git a/modules/utility/diffview/diffview.nix b/modules/utility/diffview/diffview.nix new file mode 100644 index 00000000..13d876f2 --- /dev/null +++ b/modules/utility/diffview/diffview.nix @@ -0,0 +1,14 @@ +{ + pkgs, + config, + lib, + ... +}: +with lib; +with builtins; let + cfg = config.vim.utility.diffview-nvim; +in { + options.vim.utility.diffview-nvim = { + enable = mkEnableOption "Enable diffview-nvim"; + }; +}