nix-community / home-manager

Manage a user environment using Nix [maintainer=@rycee]
https://nix-community.github.io/home-manager/
MIT License
7.13k stars 1.84k forks source link

bug: using neovim unstable pkg for neovim.package option #5642

Open sachinchaudhary1808 opened 4 months ago

sachinchaudhary1808 commented 4 months ago

Are you following the right branch?

Is there an existing issue for this?

Issue description

so i wanted latest neovim from unstable branch so i used programs.neovim.package = pkgs.unstable.neovim options.

here i defined an overlay for unstable branch to get pkgs using pkgs.unstable,

when i do

    neovim = {
      package = pkgs.unstable.neovim;
      enable = true;

and rebuild i get an error

       last 9 log lines:
       > structuredAttrs is enabled
       > Running phase: patchPhase
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: configurePhase
       > no configure script, doing nothing
       > Running phase: buildPhase
       > substituteStream() in derivation neovim-0.10.0: WARNING: '--replace' is deprecated, use --replace-{fail,warn,quiet}. (file '/nix/store/xsqpns8p3czs19dcsl7iri48lqz2mlg9-neovim-0.10.0/share/applications/nvim.desktop')
       > /nix/store/g85xmbanh5h6rwx5jd4jriai36hgk6ja-make-shell-wrapper-hook/nix-support/setup-hook: line 116: /nix/store/9fnnwi1n764dxyrqyq5wk7jab4vnajwk-neovim-0.10.0/bin/nvim-python3: Permission denied
       > /nix/store/g85xmbanh5h6rwx5jd4jriai36hgk6ja-make-shell-wrapper-hook/nix-support/setup-hook: line 131: pop_var_context: head of shell_variables not a function context
       For full logs, run 'nix log /nix/store/kqikpvs3q7fw8pyyqndji0nqm45jjri1-neovim-0.10.0.drv'.
error: 1 dependencies of derivation '/nix/store/a66xkwccvvmrlk2vm95qfq2rdp3zcfj0-home-manager-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/mdsv2r9z693kxfxqf9srar6c604vaa0r-home-manager-generation.drv' failed to build
error: 1 dependencies of derivation '/nix/store/ad0z0ywyfjpw4smyshf5kh295phhipyq-user-environment.drv' failed to build
error: 1 dependencies of derivation '/nix/store/8zsn2vf9kigfxm9m6g6vxi8v5ah5v5am-etc.drv' failed to build
error: 1 dependencies of derivation '/nix/store/rbizp6190dfxbs1z3xwwfl32sr7z1nhk-nixos-system-nixos-24.05.20240714.53e81e7.drv' failed to build

~ took 2m 

but when i use neovim-unwrapped as pkg from unstable i don't get that error also this is my git commit for nixos-unstable pkgs branch

    "nixpkgs-unstable": {
      "locked": {
        "lastModified": 1720957393,
        "narHash": "sha256-oedh2RwpjEa+TNxhg5Je9Ch6d3W1NKi7DbRO1ziHemA=",
        "owner": "nixos",
        "repo": "nixpkgs",
        "rev": "693bc46d169f5af9c992095736e82c3488bf7dbb",
        "type": "github"
      },

Maintainer CC

No response

System information

- system: `"x86_64-linux"`
 - host os: `Linux 6.6.39, NixOS, 24.05 (Uakari), 24.05.20240714.53e81e7`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Lix, like Nix) 2.90.0`
 - channels(root): `""`
 - nixpkgs: `/nix/store/hkv63lvykwr520xf8yv2gcw3s78fjfpd-source`
donovanglover commented 4 months ago

Don't think this is a home-manager issue since the versions would no longer be in sync if you're using home-manager 24.05 with neovim in unstable.

I'm using the same nixpkgs commit and everything works fine in nixos-unstable.

sachinchaudhary1808 commented 4 months ago

Don't think this is a home-manager issue since the versions would no longer be in sync if you're using home-manager 24.05 with neovim in unstable.

I'm using the same nixpkgs commit and everything works fine in nixos-unstable.

Can explain why neovim-unwrapped pkg from unstable work's?

donovanglover commented 4 months ago

Seems like an issue with your config since it doesn't include the wrapper.nix fix from 1 month ago.

sachinchaudhary1808 commented 4 months ago

Seems like an issue with your config since it doesn't include the wrapper.nix fix from 1 month ago.

Any solution ?

sachinchaudhary1808 commented 4 months ago

so i updated my system, and still it doesn't work,

here are the my dotfiles

pazbryant commented 3 months ago

@sachinchaudhary1808 were you able to fix it?

teto commented 3 months ago

this knob expects the unwrapped ("raw") version of neovim. What if you try

    neovim = {
      package = pkgs.unstable.neovim-unwrapped;
      enable = true;

?

sachinchaudhary1808 commented 3 months ago

this knob expects the unwrapped ("raw") version of neovim. What if you try

    neovim = {
      package = pkgs.unstable.neovim-unwrapped;
      enable = true;

?

As i said earlier, unwrapped one works

teto commented 3 months ago

As i said earlier, unwrapped one works

so all is good ? what do you expect ? home-manager wraps neovim, and pkgs.neovim is already wrapped. Maybe we could detect the wrappped version and throw a warning. Is that what you are thinking of ?

sachinchaudhary1808 commented 3 months ago

As i said earlier, unwrapped one works

so all is good ? what do you expect ? home-manager wraps neovim, and pkgs.neovim is already wrapped. Maybe we could detect the wrappped version and throw a warning. Is that what you are thinking of ?

I expect it to take neovim as pkg from unstable and don't give me above errors

teto commented 3 months ago

the doc could be clearer but the default mentions:

The package to use for the neovim binary.
Type: package
Default: pkgs.neovim-unwrapped

Let's add something to https://github.com/nix-community/home-manager/wiki/Neovim

sachinchaudhary1808 commented 3 weeks ago

@teto hey i think the confusion arrived from me not knowing that i can't use already wrapped neovim as a pkg for configuring neovim with home-manager can u make something clear about this in home-manager search website ?