root # nixos-rebuild switch --upgrade
unpacking channels...
building Nix...
building the system configuration...
error: attribute 'pname' missing, at /nix/var/nix/profiles/per-user/root/channels/nixos/pkgs/misc/vim-plugins/vim-utils.nix:258:41
(use '--show-trace' to show detailed location information)
nixos-rebuild switch --upgrade
"x86_64-linux"Linux 4.14.59, NixOS, 19.03pre162671.44b02b52ea6 (Koi)yesyesnix-env (Nix) 2.1.3"nixos-19.03pre164715.201d739b0ff"/nix/var/nix/profiles/per-user/root/channels/nixoscc @timokau
Broken by https://github.com/NixOS/nixpkgs/pull/52767
Proposed fix https://github.com/NixOS/nixpkgs/pull/53113
I'm not entirely sure this is the same bug. What is your vim/neovim setup @8573?
It would be best to just post the vim_configurable.configure or neovim.override expression in your configure.nix.
Hello, I have the same problem, and #53113 did not solve the problem.
It turns out that I was using pkgs.vimUtils.buildVimPluginFrom2Nix to define some custom vim plugins (which nixpkgs don't have). I did not define the pname attribute in those plugin's derivation, and at the same time https://github.com/timokau/nixpkgs/blob/d9d9ac989ab8a6bf9a89f951857fa83f45956baa/pkgs/misc/vim-plugins/vim-utils.nix#L172 tries to access the pname attribute.
Maybe you should not assume that pname is always in plugin derivation's attribute?
Can you give a minimal example with buildVimPluginsFrom2Nix to reproduce the failure?
The expression:
vim.nix (click to expand)
pkgs:
let
cfg = {
vimrcConfig.vam.knownPlugins =
pkgs.vimPlugins // ({
"vim-trailing-whitespace" = pkgs.vimUtils.buildVimPluginFrom2Nix rec {
name = "vim-trailing-whitespace";
src = pkgs.fetchFromGitHub {
owner = "bronson";
repo = "vim-trailing-whitespace";
rev = "4c596548216b7c19971f8fc94e38ef1a2b55fee6";
sha256 = "0f1cpnp1nxb4i5hgymjn2yn3k1jwkqmlgw1g02sq270lavp2dzs9";
};
dependencies = [];
};
});
vimrcConfig.vam.pluginDictionaries =
[ { names = [ "vim-trailing-whitespace"
];
} ];
name = "vim";
};
in
pkgs.lib.overrideDerivation (pkgs.vim_configurable.customize cfg) (o: { })
Then use nix repl to build it:
nix-repl> pkgs = import <nixpkgs> {}
nix-repl> :b import ./vim.nix pkgs
error: attribute 'pname' missing, at /nix/store/0xxqwhx8bllq2cyns1c1pqnpkwgwpp74-nixos-19.03pre164715.201d739b0ff/nixos/pkgs/misc/vim-plugins/vim-utils.nix:258:41
Thanks!
Okay, should be fixed with #53121. Sorry for the breakage! Its hard to predict all the possible ways people may be using vim-utils.nix. We need more tests. I've added your example as a test to make sure this doesn't happen again.
What is your vim/neovim setup @8573? [...] It would be best to just post the
vim_configurable.configureorneovim.overrideexpression in yourconfigure.nix.
I guess I share @sifmelcara's issue; thanks for (I hope) fixing it.
I confirm that this issue appears to be fixed for me. Thanks, @timokau!
Most helpful comment
Okay, should be fixed with #53121. Sorry for the breakage! Its hard to predict all the possible ways people may be using
vim-utils.nix. We need more tests. I've added your example as a test to make sure this doesn't happen again.