nix-community / home-manager

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

Enabling neovim in options throws an error #1577

Closed SenchoPens closed 4 years ago

SenchoPens commented 4 years ago

Description

Since this commit executing nixos-rebuild switch throws an error:

error: --- TypeError ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- nix
at: (151:10) in file: /nix/store/d2h4pc8xx5b3nmsrqjyaxixlzsfqdkcv-source/pkgs/applications/editors/neovim/utils.nix

   150|       wrapperArgs = res.wrapperArgs
   151|       ++ [
      |          ^
   152|         "--add-flags" "-u ${writeText "init.vim" res.neovimRcContent}"

value is the partially applied built-in function 'trace' while a list was expected
(use '--show-trace' to show detailed location information)

Maintainer CC

@beardhatcode

Steps to reproduce

  home-manager.users.sencho.programs.neovim = {
    enable = true;
  };

}

Technical details

berbiche commented 4 years ago

@teto ping since git blame is pointing towards your changes to neovim/utils.nix on nixpkgs

beardhatcode commented 4 years ago

I cannot reproduce this issue.

But from what I see, @teto changed the nvim package in the nixpkgs to no longer use extraMakeWrapperArgs as a string. But to use wrapperArgs as an array. I do not have time to fix and test this now (I will tomorrow).

Edit: the patch below may fix it but i did not test it. https://github.com/beardhatcode/home-manager/commit/5f33dfe82bc315b4043b64f26cd73a10c04aca65

teto commented 4 years ago

wow that was fast, are you using master ? the change doesn't seem to have reached unstable yet ! sorry that it broke your setup, I will try to fix it this evening. With those changes, it's now possible for home-manager to write the neovim config directly in $XDG_CONFIG_HOME/nvim/init.vim, thus avoiding issues linked to -u. Here is how to do it (I currently write it to init.generated.vim) https://github.com/teto/home-manager/blob/scratch/modules/programs/neovim.nix#L260

SenchoPens commented 4 years ago

Hi, I use flakes and yesterday tried to update to master. No problem, I have no particular need in the most recent home-manager, I will just use the older revision, but to you guys great thanks for working on the amazing home-manager! Hope I will be able to contribute something too in the future.

colemickens commented 4 years ago

This hit nixos-unstable-small at least, btw.

reedrw commented 4 years ago

The build no longer fails but programs.neovim.vimAlias seems to no longer work.

beardhatcode commented 4 years ago

This issue is fixed in nixpkgs (https://github.com/NixOS/nixpkgs/pull/102231) by @teto

evalexpr commented 4 years ago

@reedrw maybe we should create a new issue for that? I've noticed the same behavior

teto commented 4 years ago

no need to create another issue: I will have a look at it tomorrow.

jonringer commented 4 years ago

Should we wrap the application outside of nixpkgs?

There's nothing to guarantee alignment between home-manager and nixpkgs.

I think it would make sense for nixpkgs to provide a neovim-unwrapped packaged, but if someone were to be using home-manager, then we would probably want to wrap the settings within the context of home-manager.

teto commented 4 years ago

I think it would make sense for nixpkgs to provide a neovim-unwrapped packaged

It is already the case, it's even called neovim-unwrapped.

but if someone were to be using home-manager, then we would probably want to wrap the settings within the context of home-manager.

if home-manager generates $XDG_CONFIG_HOME/nvim/init.vim, then we shouldn't need to wrap neovim-unwrapped.

btw I've merged a fix for the vi(m)Alias issue https://github.com/NixOS/nixpkgs/pull/102605

reedrw commented 4 years ago

Seems like everything is good now. Thanks! 👍