Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

programs.neovim.configure is not working in master #1806

Closed
thiagokokada opened this issue Feb 17, 2021 · 9 comments
Closed

programs.neovim.configure is not working in master #1806

thiagokokada opened this issue Feb 17, 2021 · 9 comments
Labels

Comments

@thiagokokada
Copy link
Contributor

Issue description

programs.neovim.configure doesn't work in master, but works in release-20.09.

Minimal test example (probably a good idea to add a more complete version of it as a test to ensure it doesn't break in the future):

{ config, lib, pkgs, ... }:

with lib;

{
  config = {
    programs.neovim = {
      enable = true;
      configure = {
        customRC = ''
          " This should be present in vimrc
        '';
        packages.myVimPackage = with pkgs.vimPlugins; { };
      };
    };

    nmt.script = ''
    '';
  };
}

Running it results:

$ nix-shell -I nixpkgs=channel:nixpkgs-unstable --pure tests -A run.neovim-configure-test                                           ERROR
building '/nix/store/q0m4zfbzs74pckhm6337n8daa1flfmqm-nmt-test-script-neovim-plugin-config.drv'...
building '/nix/store/ncjy3f54rh3yvmi3mbpcjlbnh6r36l4d-nmt-report-neovim-plugin-config.drv'...
tput: unknown terminal "xterm-kitty"
neovim-plugin-config: FAILED
Expected home-files/asserts/assertions.actual to be same as /nix/store/myjfnj41yxhpr2mb3vlkm5x8nwyjl7gp-assertions.expected but were different:
--- actual
+++ expected
@@ -1 +0,0 @@
-The programs.neovim option configure is mutually exclusive with extraConfig and plugins.
\ No newline at end of file
For further reference please introspect /nix/store/jhmpyd3rz54qihig3kbx6hjf5q9zq1a1-nmt-report-neovim-plugin-conf

Meta

Maintainer CC

@teto

Technical details

  • system: "x86_64-linux"
  • host os: Linux 5.8.7-zen1, NixOS, 20.09.20210213.2118cf5 (Nightingale)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.4pre20201201_5a6ddb3
  • channels(root): "nixos-20.09.3124.2118cf551b9"
  • nixpkgs: /nix/store/iv5kvpbswff5m4kfsh0x7vaj1g18axls-source
@teto
Copy link
Collaborator

teto commented Feb 17, 2021

As mentioned in another issue, let's get rid of configure. Makes things unnecessarily complex and is a relic of the past. You wouldn't be using home-manager if you wanted to use configure in the first place. I can try sthg in the upcoming days.

@thiagokokada
Copy link
Contributor Author

@teto configure AFAIK still supports some things that extraConfig+plugins doesn't (like using vim-plug). So maybe some users can be angry with this change.

For me I don't particularly use any feature only available with configure, so if this is the idea I can migrate my config.

@thiagokokada
Copy link
Contributor Author

And now I remembered that I can't migrate to extraConfig because release-20.09 lacks optional.

@teto
Copy link
Collaborator

teto commented Feb 17, 2021

My feeling is that features offered by configure.vim-plug / pathogen should not be necessary with good enough designed plugins. Once you put plugins in packpath, the goal of nixpkgs is kinda done.

As for release-20.09 lacking optional, you can cherry-pick the change/backport or write a small function that preprocess your list of plugin.
I've put up this that doesn't remove configure yet to leave some time for people to migrate.
#1810

@thiagokokada
Copy link
Contributor Author

Could we pick the optional changes in release-20.09? This would be interesting to make the migration path easier.

@thiagokokada
Copy link
Contributor Author

Opened a PR with the backport.

@pinpox
Copy link
Contributor

pinpox commented Feb 19, 2021

This might be related: https://github.com/NixOS/rfcs/blob/master/rfcs/0042-config-option.md
Using extraConfig is being deprecated, if I understand correctly.

@teto
Copy link
Collaborator

teto commented Feb 19, 2021

It's not related but it could be interesting if it would allow to set nix variables and convert them either in vimscript or lua afterwards. Even then both are programming languages so the string format looks sensible

@teto teto closed this as completed Feb 22, 2021
@teto teto pinned this issue Feb 22, 2021
@teto
Copy link
Collaborator

teto commented Feb 22, 2021

content of configure is now unconditionnally overwritten by home manager options so depending on what you use you can end up with a weird config. Its temporary until everyone migrates then I will remove configure

@teto teto unpinned this issue Mar 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants