GithubHelp home page GithubHelp logo

Comments (6)

PrimaMateria avatar PrimaMateria commented on July 4, 2024 1

I must be blind. It's pretty obvious, I didn't read properly the whole Makefile.

I use nix to manage my neovim configuration, and it replaces also the vim package managers. It allows me to also declare neovim related external dependencies like language servers, or tools like lazy git.

I am still quite a noob. Please keep this issue still open, and if I will figure it out, then I will close it.

from no-neck-pain.nvim.

shortcuts avatar shortcuts commented on July 4, 2024

Hey, thanks for the issue!

During the build, the test phase in Makefile fails with error that module mini.test is missing.

make deps/mini.nvim will do the install for you, then you should be able to run make test!

You can also take a look at make test-ci that first install deps before running the tests.

I was trying to build this plugin with nix

Sorry, noob question here, but what's the reason to build it with nix?

from no-neck-pain.nvim.

shortcuts avatar shortcuts commented on July 4, 2024

I should however rename the deps step to make it more straight forward

from no-neck-pain.nvim.

shortcuts avatar shortcuts commented on July 4, 2024

I must be blind. It's pretty obvious, I didn't read properly the whole Makefile.

No problem!

I use nix to manage my neovim configuration, and it replaces also the vim package managers. It allows me to also declare neovim related external dependencies like language servers, or tools like lazy git.

Oh make sense, never tried it this way!

from no-neck-pain.nvim.

PrimaMateria avatar PrimaMateria commented on July 4, 2024

Ok, I made it work. All the troubles I was facing was that when I try to package the plugin as nix derivation, it automatically executes the make command.

First, the mini.nvim needs to be prefetched via nix, because during the build there is no internet connection to fetch deps via git.
Then I had an issue about duplicated doc tags. I think this was caused, because make runs mini.doc to set up the tags, and then nix also runs post-install phase to generate docs, which causes conflicts.

At the end, I have realized, that your repo is actually a ready-to-go plugin without a need to build it first. Nix's vim plugin builder will take care of correctly integrating it.

Here is how it looks in case someone else stumbles upon this issue:

{
  inputs = {
    nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
    flake-utils.url = "github:numtide/flake-utils";

    neovim = {
      url = "github:neovim/neovim?dir=contrib";
      inputs.nixpkgs.follows = "nixpkgs-unstable";
    };

    noneckpain-src = {
      url = "github:shortcuts/no-neck-pain.nvim";
      flake = false;
    };
  };

  outputs = inputs@{ self, flake-utils, nixpkgs-unstable, neovim, noneckpain-src, ... }:
    let
      noneckpain = pkgs: pkgs.vimUtils.buildVimPlugin {
        name = "noneckpain";
        src = noneckpain-src;
        dontBuild = true;
      };

      overlay = prev: final: rec {      
        # Use wrapper from nixpkgs which will supply config file and plugins
        neovimPrimaMateria = prev.wrapNeovim neovim.packages.x86_64-linux.neovim {
          withNodeJs = true;
          configure = {
            packages.myVimPackage.start = [
              (noneckpain prev)
            ];
          };
        };
      };

    in flake-utils.lib.eachDefaultSystem (system:
      let
        pkgs = import nixpkgs-unstable {
          inherit system;
          overlays = [ overlay ];
        };
      in {
        packages = rec {
          inherit (pkgs) neovimPrimaMateria;
          default = neovimPrimaMateria;
        };

        apps = rec {
          neovimPrimaMateria= {
            type = "app";
            program = "${pkgs.neovimPrimaMateria}/bin/nvim";
          };
          default = neovimPrimaMateria;
        };
      });
}

The best would be to add it to nixpkgs repository, so it will work for everyone out of the box. If I find a time, I will try to look at it.

from no-neck-pain.nvim.

shortcuts avatar shortcuts commented on July 4, 2024

Ok, I made it work. All the troubles I was facing was that when I try to package the plugin as nix derivation, it automatically executes the make command.

I don't need the all rule anyway so I've disabled it: 3415e6d

Could you let me know if it makes things easier on your side?

In any case, thanks a lot for your investigation! I'll add a section to the wiki :)

The best would be to add it to nixpkgs repository, so it will work for everyone out of the box. If I find a time, I will try to look at it.

I'm not sure how it works on their side but can definitely take a look!

from no-neck-pain.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.