Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vimPlugins.galaxyline-nvim: init at 2020-12-14 #106931

Merged
merged 1 commit into from Jan 18, 2021

Conversation

jlesquembre
Copy link
Member

Motivation for this change

Add https://github.com/glepnir/galaxyline.nvim

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@samb96
Copy link
Contributor

samb96 commented Dec 15, 2020

Result of nixpkgs-review pr 106931 1

2 packages built:
  • spacevim
  • vimPlugins.galaxyline-nvim

@samb96
Copy link
Contributor

samb96 commented Dec 15, 2020

When I use this plugin to customize neovim, it fails to build.

This is the expression I used:

{ pkgs }:

pkgs.neovim.override {
  configure = {
    packages.myVimPackage = with pkgs.vimPlugins; {
      start = [ galaxyline-nvim ];
      opt = [ ];
    };
  };
}

This is the output:

$ nix-build --no-out-link ./test-nvim.nix --arg pkgs 'import ./nixpkgs {}'
these derivations will be built:
  /nix/store/xmpr2c4wydvxpp4f6801n3a36n8dapkk-neovim-0.4.4.drv
building '/nix/store/xmpr2c4wydvxpp4f6801n3a36n8dapkk-neovim-0.4.4.drv'...
Generating remote plugin manifest
Error detected while processing BufEnter Autocommands for "*":
E5105: Error while calling lua chunk: ...ck/myVimPackage/start/galaxyline-nvim/lua/galaxyline.lua:192: attempt to index field 'bo' (a nil value)
Error detected while processing BufWinEnter Autocommands for "*":
E5105: Error while calling lua chunk: ...ck/myVimPackage/start/galaxyline-nvim/lua/galaxyline.lua:192: attempt to index field 'bo' (a nil value)
Error detected while processing BufEnter Autocommands for "*":
E5105: Error while calling lua chunk: ...ck/myVimPackage/start/galaxyline-nvim/lua/galaxyline.lua:192: attempt to index field 'bo' (a nil value)
remote/host: generated rplugin manifest: /nix/store/f1nf4gzj6p9r1mg6if5g6gzdcvx2as9f-neovim-0.4.4/rplugin.vim
Generating rplugin.vim failed!
builder for '/nix/store/xmpr2c4wydvxpp4f6801n3a36n8dapkk-neovim-0.4.4.drv' failed with exit code 1
error: build of '/nix/store/xmpr2c4wydvxpp4f6801n3a36n8dapkk-neovim-0.4.4.drv' failed

@jlesquembre
Copy link
Member Author

jlesquembre commented Dec 15, 2020

I forgot to mention that this plugin requires neovim 0.5. I see many plugins on nixpkgs that also require 0.5, and I assumed that it would be ok to add this plugin too.

I'm not sure why the OfBorg failed, maybe because I'm not a trusted user?

In any case, if you want to test it with 0.5, is relatively easy since a flake.nix was added to the neovim repo:
https://github.com/neovim/neovim/blob/82100a6bdb42cec30060d6c991ab78fd2331fa31/contrib/flake.nix

An adapted version of your expression that works:

# to test it:
# nix-build --no-out-link ./test-nvim.nix --arg pkgs 'import ./nixpkgs {}'
{ pkgs }:
let 
  neovim-nightly = pkgs.neovim-unwrapped.overrideAttrs (oa: {
    version = "master";
    src = pkgs.fetchFromGitHub {
      owner = "neovim";
      repo = "neovim";
      rev = "52e660e8570346d28f5c7f5dde0a5ca9b614a801";
      sha256 = "0swrk1q56ri5bil8sap6nnv2filfch72011bbd7f6yfhhy9gk6nx";
    };

    buildInputs = oa.buildInputs ++ ([
      pkgs.tree-sitter
    ]);

    cmakeFlags = oa.cmakeFlags ++ [
      "-DUSE_BUNDLED=OFF"
    ];
  });
in
pkgs.wrapNeovim neovim-nightly {
  configure = {
    packages.myVimPackage = with pkgs.vimPlugins; {
      start = [ galaxyline-nvim ];
      opt = [ ];
    };
  };
}

@teto
Copy link
Member

teto commented Dec 15, 2020

I have not communicated about the flake.nix on master (yet) but happy to see it is helpful :)

NB: someone voiced concern at packaging polugins targeting neovim-unstable but now it is fine I think. Maybe we should move those to a flake in the long run since they can cause some churn in the main repo.

@samb96
Copy link
Contributor

samb96 commented Dec 15, 2020

The adapted version of your expression does succeed to build. It does give give an error message when I start neovim. I'll include the error message, but I doubt its an issue on your end.

As for the OfBorg failure, its not an issue on your end. At the time you submitted your pull request there was a typo in an attribute name in nixpkgs master. For a period of ~3 hours all OfBorg checks failed.

Here's the error message I got when starting neovim:

Error detected while processing /nix/store/912h46nwyksdvlv3mqbwx1z63y1i5b96-vimplugin-galaxyline-nvim-2020-12-14/share/vim-plugins/galaxyline-nvim/plugin/galaxyline.vim:
line   15:
E5108: Error executing lua vim.lua:267: module 'vim.uri' not found:
        no field package.preload['vim.uri']
        no file './vim/uri.lua'
        no file '/nix/store/62h7raxpscqaq0fzqzjk0dbgsr4njxij-luajit-2.1.0-2020-09-30/share/luajit-2.1.0-beta3/vim/uri.lua'
        no file '/usr/local/share/lua/5.1/vim/uri.lua'
        no file '/usr/local/share/lua/5.1/vim/uri/init.lua'
        no file '/nix/store/62h7raxpscqaq0fzqzjk0dbgsr4njxij-luajit-2.1.0-2020-09-30/share/lua/5.1/vim/uri.lua'
        no file '/nix/store/62h7raxpscqaq0fzqzjk0dbgsr4njxij-luajit-2.1.0-2020-09-30/share/lua/5.1/vim/uri/init.lua'
        no file './vim/uri.so'
        no file '/usr/local/lib/lua/5.1/vim/uri.so'
        no file '/nix/store/62h7raxpscqaq0fzqzjk0dbgsr4njxij-luajit-2.1.0-2020-09-30/lib/lua/5.1/vim/uri.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
        no file './vim.so'
        no file '/usr/local/lib/lua/5.1/vim.so'
        no file '/nix/store/62h7raxpscqaq0fzqzjk0dbgsr4njxij-luajit-2.1.0-2020-09-30/lib/lua/5.1/vim.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'

@jlesquembre
Copy link
Member Author

@teto thanks for the flake, it is really helpful, in fact, I decided to move to 0.5 when I saw it in the neovim repo :)
I agree with you, makes a lot of sense to move the plugins to a flake once flakes are out of beta

@samb96 thanks for testing, unfortunately I don't know why you are getting that error, I cannot reproduce it, I just tested it again with latest master and all looks good on my side. Also, thanks for pointing out about the OfBorg error, I wasn't aware

@jlesquembre
Copy link
Member Author

@GrahamcOfBorg build vimPlugins.galaxyline-nvim

@SuperSandro2000
Copy link
Member

@ofborg eval

@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review which is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 106931 run on x86_64-linux 1

2 packages built:
  • spacevim
  • vimPlugins.galaxyline-nvim

@SuperSandro2000 SuperSandro2000 merged commit 2c1c292 into NixOS:master Jan 18, 2021
@jlesquembre jlesquembre deleted the galaxyline-nvim branch January 19, 2021 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants