vyfor / cord.nvim

🚀 Discord Rich Presence plugin for Neovim written in Rust
Apache License 2.0
156 stars 8 forks source link

Build fails when using Lazy on NixOS #117

Open NklsCh opened 3 hours ago

NklsCh commented 3 hours ago

Description

Build failed when using NixOS - had to got into ~/.local/share/nvim/lazy/cord.nvim run direnv allow and manually run the build file again

Operating system

NixOS 24.04

Neovim version

NVIM v0.10.2
Build type: Release
LuaJIT 2.1.1713773202

Steps to reproduce

  1. Added plugin into File
  2. Run :Lazy
  3. ^I = Build fails

Expected behavior

Install plugin without any problem

Actual behavior

Build fails

Minimal configuration

local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
if not (vim.uv or vim.loop).fs_stat(lazypath) then
  vim.fn.system({
    'git',
    'clone',
    '--filter=blob:none',
    'https://github.com/folke/lazy.nvim.git',
    '--branch=stable',
    lazypath,
  })
end
vim.opt.rtp:prepend(lazypath)

require('lazy').setup({
  {
    'vyfor/cord.nvim',
    build = './build',
    opts = {},
  },
}, {})
vyfor commented 3 hours ago

Does it say why the build fails?

NklsCh commented 3 hours ago
Error detected while processing User Autocommands for "VeryLazy":
[cord.nvim] Could not find the compiled dynamic library at: /home/choinowski/.local/share/nvim/lazy/cord.nvim/cord.so. Please re-run the build script
NklsCh commented 3 hours ago

As stated above manually going into the ~/.local/share/nvim/lazy/cord.nvim executing direnv allow and then ./build resolved this

vyfor commented 3 hours ago

I don't have any experience using NixOS or direnv so I'd like to clarify something. Is it not possible to run the build script unless you execute that command?

NklsCh commented 3 hours ago

Affirmative

vyfor commented 2 hours ago

Hey @redyf, do you know why this might be happening?

NklsCh commented 2 hours ago

So i figured when using nixos or nix in any way putting nix develop in will work fine making the .envrc irrelevant im going to make a pr with possible changes for this. Pls correct me if any of my changes might be wrong