Comments (13)
It may be that the master image.nvim has changes from the nixpkgs one. The other posibility is that image.nvim has nixpkgs overrides. I would consider doing pkgs.vimPlugins.image-nvim.overiddeAttrs (_: { src = ipnuts.image-nvim; })
, that would handle the second case.
from nixvim.
Exatcly!
from nixvim.
As an aside, which could actually be a nixvim
bug, while trying to debug this issue I forked image.nvim
and added a non-flake input to this test config. Then I change config/default.nix
like this:
{
pkgs,
inputs,
...
}:
{
# Import all your configuration modules here
imports = [
./bufferline.nix
];
plugins.image = {
enable = true;
package = let
image-nvim = pkgs.vimUtils.buildVimPlugin {
name = "image.nvim";
src = inputs.image-nvim;
};
in image-nvim;
};
}
Now when I run nix run .#
, I get this error:
Error detected while processing /nix/store/7n4hrzs3kv68r5mr22xbyxb695hb4dpy-init.lua:
image.nvim: magick rock not found, please install it and restart your editor
If I comment out the overwritten package (such that I get the nixpkgs version), I get no error. As far as I understand the nixvim
implementation of plugins.image
, this should be available either way?
from nixvim.
Thanks, adding that override solved that issue! I expect using an autocmd on UIEnter
around the functions which actually requires the UI to be available should solve this. I'll open an issue on the image.nvim
plugin repo.
from nixvim.
There seems to be several places where this plugin assumes we are not in a headless mode, so I think there might not be a simple way to fix this. Is there a way to just remove this plugin when I run nix flake check .
, without removing it for my actual config?
from nixvim.
There should be a way to disable running the tests in nixvim
from nixvim.
We should have disabled it:
empty = {
# At runtime, the plugin tries to get the size of the terminal which doesn't exist in the
# headless environment.
tests.dontRun = true;
plugins.image.enable = true;
};
from nixvim.
Ah I see your issue, you are trying to use it for your own config. That's an issue I had not yet considered!
from nixvim.
You may want to disable image.nvim while running in the test derivation. I'll think of a way to do it automatically though.
from nixvim.
Yeah, is there a way to override the config set from the result of makeNixvimWithModule?
from nixvim.
With #1095 there is now a way to handle this! I updated the template at https://github.com/nix-community/nixvim/blob/main/templates/simple/flake.nix if you want an example on how to make this work
from nixvim.
Thank you for the quick work! I tried to update my flake based on this, if I update my flake and do these changes, should it work?
diff --git a/flake.nix b/flake.nix
index 76479c7..727074f 100644
--- a/flake.nix
+++ b/flake.nix
@@ -50,7 +50,8 @@
}: let
nixvimLib = nixvim.lib.${system};
nixvim' = nixvim.legacyPackages.${system};
- nvim = nixvim'.makeNixvimWithModule {
+
+ nixvimModule = {
inherit pkgs;
module = config;
# You can use `extraSpecialArgs` to pass additional arguments to your module files
@@ -59,6 +60,8 @@
inherit inputs;
};
};
+
+ nvim = nixvim'.makeNixvimWithModule nixvimModule;
in {
_module.args.pkgs = import nixpkgs {
inherit system;
@@ -72,10 +75,7 @@
checks = {
# Run `nix flake check .` to verify that your config is not broken
- default = nixvimLib.check.mkTestDerivationFromNvim {
- inherit nvim;
- name = "A nixvim configuration";
- };
+ default = nixvimLib.check.mkTestDerivationFromNixvimModule nixvimModule;
};
packages = {
I tried this and get the same error. Or should I use helpers.enableExceptInTests
to enable the image
plugin as well?
from nixvim.
Works perfectly, thank you!
from nixvim.
Related Issues (20)
- [PLUGIN REQUEST] zellij-nav.nvim HOT 2
- Cannot find word list "fr.utf-8.spl" or "fr.ascii.spl" HOT 1
- Improve config files and rtp handling HOT 9
- [BUG] Svelte syntax highlighting broken HOT 2
- Adding plugins gives an error with the module not being found HOT 3
- [PLUGIN REQUEST] nvim-dbee
- Example in README.md: Lightline.vim could not load colorscheme gruvbox. (While running without `sudo`) HOT 9
- Deprecate `helpers.mkRaw` in favour of `lib.generators.mkLuaInline` HOT 7
- [BUG] LSP `volar` requires additional configuration
- [BUG] Hydra as a dependency to multicursors throws warning HOT 1
- [BUG] format: no formatter for path: .editorconfig
- [BUG] Nixvim fails to build in cross-compile HOT 3
- `mkPackageOption` helper with `defaultText`
- lsp.servers.nil-ls crashes [BUG] <BUG>
- [BUG] rust-analyzer stops providing diagnostics without clear reason HOT 4
- [BUG] luasnip filetype_extend
- [BUG] tsserver seems to be broken when NOT running via `nix run .` HOT 1
- `plugins.*.package` should be nullable, to use package from system. HOT 7
- [BUG] `templ` files handled as plaintext files when templ LSP is enabled HOT 8
- [PLUGIN REQUEST] neotest-golang
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nixvim.