diff --git a/flake.lock b/flake.lock index f1828f7..a3fa4b1 100644 --- a/flake.lock +++ b/flake.lock @@ -610,17 +610,17 @@ }, "nixpkgs_8": { "locked": { - "lastModified": 1649986882, - "narHash": "sha256-cNsInUFq1MbuvaEmv8x6jetWnmAU+osMpnwKumtjksI=", + "lastModified": 1651007983, + "narHash": "sha256-GNay7yDPtLcRcKCNHldug85AhAvBpTtPEJWSSDYBw8U=", "owner": "nixos", "repo": "nixpkgs", - "rev": "5181d5945eda382ff6a9ca3e072ed6ea9b547fee", + "rev": "e10da1c7f542515b609f8dfbcf788f3d85b14936", "type": "github" }, "original": { "owner": "nixos", "repo": "nixpkgs", - "rev": "5181d5945eda382ff6a9ca3e072ed6ea9b547fee", + "rev": "e10da1c7f542515b609f8dfbcf788f3d85b14936", "type": "github" } }, @@ -769,7 +769,8 @@ "nixos-shell": "nixos-shell", "nixos-vscode-server": "nixos-vscode-server", "nixpkgs": "nixpkgs_8", - "vim-eldar": "vim-eldar" + "vim-eldar": "vim-eldar", + "zk-nvim": "zk-nvim" } }, "rotate-text": { @@ -803,6 +804,22 @@ "repo": "vim-eldar", "type": "github" } + }, + "zk-nvim": { + "flake": false, + "locked": { + "lastModified": 1644774268, + "narHash": "sha256-/2uR8DMtI01nVlyydUoVUBj/yB/FOWmNSz6vgpRK800=", + "owner": "mickael-menu", + "repo": "zk-nvim", + "rev": "d705faa82da042e7a75f7d244afd27c2d8f20830", + "type": "github" + }, + "original": { + "owner": "mickael-menu", + "repo": "zk-nvim", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 3a571a2..67c8c0a 100644 --- a/flake.nix +++ b/flake.nix @@ -6,7 +6,7 @@ # https://status.nixos.org/ # # This ensures that we always use the official nix cache. - nixpkgs.url = "github:nixos/nixpkgs/5181d5945eda382ff6a9ca3e072ed6ea9b547fee"; + nixpkgs.url = "github:nixos/nixpkgs/e10da1c7f542515b609f8dfbcf788f3d85b14936"; darwin.url = "github:lnl7/nix-darwin/master"; darwin.inputs.nixpkgs.follows = "nixpkgs"; @@ -26,6 +26,8 @@ vim-eldar.flake = false; himalaya.url = "github:soywod/himalaya"; himalaya.flake = false; + zk-nvim.url = "github:mickael-menu/zk-nvim"; + zk-nvim.flake = false; }; outputs = inputs@{ self, home-manager, nixpkgs, darwin, ... }: diff --git a/home/neovim.nix b/home/neovim.nix index 84e3fe0..6abbb7b 100644 --- a/home/neovim.nix +++ b/home/neovim.nix @@ -30,6 +30,7 @@ in extraPackages = [ pkgs.lazygit pkgs.himalaya + pkgs.zk ]; # Full list here, @@ -165,6 +166,37 @@ in ''; } vim-markdown + { + plugin = + (pkgs.vimUtils.buildVimPlugin { + name = "zk-nvim"; + src = inputs.zk-nvim; + }); + type = "lua"; + config = '' + require("zk").setup({ + -- can be "telescope", "fzf" or "select" (`vim.ui.select`) + -- it's recommended to use "telescope" or "fzf" + picker = "telescope", + + lsp = { + -- `config` is passed to `vim.lsp.start_client(config)` + config = { + cmd = { "zk", "lsp" }, + name = "zk", + -- on_attach = ... + -- etc, see `:h vim.lsp.start_client()` + }, + + -- automatically attach buffers in a zk notebook that match the given filetypes + auto_attach = { + enabled = true, + filetypes = { "markdown" }, + }, + }, + }) + ''; + } ]; # Add library code here for use in the Lua config from the