diff --git a/pkgs/applications/editors/vim/plugins/overrides.nix b/pkgs/applications/editors/vim/plugins/overrides.nix index c6935696cd7b..399703cbd6cc 100644 --- a/pkgs/applications/editors/vim/plugins/overrides.nix +++ b/pkgs/applications/editors/vim/plugins/overrides.nix @@ -2756,9 +2756,15 @@ in ]; }; - peek-nvim = super.peek-nvim.overrideAttrs { - runtimeDeps = [ deno ]; - }; + peek-nvim = super.peek-nvim.overrideAttrs (old: { + patches = [ + # Patch peek-nvim to run using nixpkgs deno + # This means end-users have to build peek-nvim the first time they use it... + (replaceVars ./patches/peek-nvim/cmd.patch { + deno = lib.getExe deno; + }) + ]; + }); persisted-nvim = super.persisted-nvim.overrideAttrs { nvimSkipModules = [ diff --git a/pkgs/applications/editors/vim/plugins/patches/peek-nvim/cmd.patch b/pkgs/applications/editors/vim/plugins/patches/peek-nvim/cmd.patch new file mode 100644 index 000000000000..3c80e55e285b --- /dev/null +++ b/pkgs/applications/editors/vim/plugins/patches/peek-nvim/cmd.patch @@ -0,0 +1,37 @@ +diff --git a/app/src/main.ts b/app/src/main.ts +index c82d914..e8542f3 100644 +--- a/app/src/main.ts ++++ b/app/src/main.ts +@@ -73,7 +73,7 @@ async function init(socket: WebSocket) { + const onListen: Deno.ServeOptions['onListen'] = ({ hostname, port }) => { + const serverUrl = `${hostname.replace('0.0.0.0', 'localhost')}:${port}`; + logger.info(`listening on ${serverUrl}`); +- const webview = new Deno.Command('deno', { ++ const webview = new Deno.Command('@deno@', { + cwd: dirname(fromFileUrl(Deno.mainModule)), + args: [ + 'run', +diff --git a/lua/peek/app.lua b/lua/peek/app.lua +index af5148e..5e67563 100644 +--- a/lua/peek/app.lua ++++ b/lua/peek/app.lua +@@ -38,10 +38,17 @@ function module.setup() + end + + cmd = vim.list_extend({ +- 'deno', +- 'task', +- '--quiet', ++ '@deno@', + 'run', ++ '--allow-read', ++ '--allow-write', ++ '--allow-net', ++ '--allow-env', ++ '--allow-run', ++ '--no-check', ++ '--allow-import', ++ '--no-lock', ++ '../../app/src/main.ts', + }, args) + end