nvf icon indicating copy to clipboard operation
nvf copied to clipboard

Trying to setup nixd

Open wllianwd opened this issue 10 months ago • 1 comments

⚠️ Please verify that this bug has NOT been reported before.

  • [x] I checked all existing issues and didn't find a similar issue

Description

Here the sample repository: https://github.com/wllianwd/my-nix-macbook/tree/main

I'm trying to configure nixd like this:

{ ... }:

let
  global = import ../../global.nix;
in
{
  programs.nvf = {
    enable = true;
    settings = {
      vim = {
        theme = {
          enable = true;
          name = "gruvbox";
          style = "dark";
        };
        statusline.lualine.enable = true;
        telescope.enable = true;
        autocomplete.nvim-cmp.enable = true;

        languages = {
          enableLSP = true;
          enableTreesitter = true;

          nix = {
            enable = true;
            lsp = {
              options = {
                nix_darwin = {
                  expr = "(builtins.getFlake \"${global.nixConfigDirectory}\").darwinConfigurations.\"${global.host}\".options";
                };
                home_manager = {
                  expr = "(builtins.getFlake \"${global.nixConfigDirectory}\").homeConfigurations.\"${global.username}\".options";
                };
              };
            };
          };
        };
      };
    };
  };
}

But seems it is not been able to find nix_darwin or home_manager correctly, is this correct?

👟 Reproduction steps

Configure like specified, build nvf.

👀 Expected behavior

Nvim should be able to find the flakes.

😓 Actual Behavior

Currently it is like this:

Image Image

💻 Metadata

 - system: `"aarch64-darwin"`
 - host os: `Darwin 24.3.0, macOS 15.3.2`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Lix, like Nix) 2.92.0
System type: aarch64-darwin
Additional system types: x86_64-darwin
Features: gc, signed-caches
System configuration file: /etc/nix/nix.conf
User configuration files: ...
Store directory: /nix/store
State directory: /nix/var/nix
Data directory: /nix/store/...

📝 Relevant log output

-

wllianwd avatar Mar 20 '25 17:03 wllianwd

The default nix lsp is nil, set vim.languages.nix.lsp.server = "nixd" to use nixd

horriblename avatar Mar 22 '25 12:03 horriblename