nix-community / nixvim

Configure Neovim with Nix! [maintainers=@GaetanLepage, @traxys, @mattsturgeon, @khaneliman]
https://nix-community.github.io/nixvim
MIT License
1.74k stars 266 forks source link

[BUG] error: `phpcbf` is now deprecated, use `php-codesniffer` instead which contains both `phpcs` and `phpcbf`. #1160

Closed lanjoni closed 8 months ago

lanjoni commented 8 months ago
Field Description
Plugin all
Nixpkgs unstable
Home Manager unstable

Description

I'm trying to install NixVim in my Nix darwin and NixOS env, but I can't. The error is about one of the plugins, and I haven't installed or configured any configuration file (for plugin or something else) for NixVim.

Minimal, Reproducible Example (MRE)

That's my flake.nix!

{
  description = "snowflake config for guto's macbook pro";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; # nixos-23.11
    nixpkgs-firefox-darwin.url = "github:bandithedoge/nixpkgs-firefox-darwin";
    nixpkgs-firefox-nightly.url = "github:colemickens/flake-firefox-nightly";

    home-manager.url = "github:nix-community/home-manager/master";
    home-manager.inputs.nixpkgs.follows = "nixpkgs";

    nixvim.url = "github:nix-community/nixvim";
    nixvim.inputs.nixpkgs.follows = "nixpkgs";

    darwin.url = "github:lnl7/nix-darwin";
    darwin.inputs.nixpkgs.follows = "nixpkgs";
  };

  outputs = inputs@{ nixpkgs, home-manager, nixvim, darwin, ... }: {
    darwinConfigurations.artemis = darwin.lib.darwinSystem {
      system = "aarch64-darwin";
      pkgs = import nixpkgs { 
        system = "aarch64-darwin";
        config.allowUnfree = true; 
      };
      modules = [
        ./modules/darwin
        home-manager.darwinModules.home-manager
        {
          home-manager = {
            useGlobalPkgs = true;
            useUserPackages = true;
            users.guto.imports = [ 
                # NixVim module
              nixvim.homeManagerModules.nixvim 
              ./modules/home-manager 
            ];
          };
        }
      ];
    };
  };
}
traxys commented 8 months ago

Is your nixpkgs revision recent enough? Meaning have you run nix flake update recently?

lanjoni commented 8 months ago

Thanks! This changed my situation: I was using an old revision of nixpkgs and now my nixvim is installed with home-manager module. But, when I tried to run this flake I got this error:

image
# modules/home-manager/default.nix
{ pkgs, ... }: {
  # specify my home-manager configs
  imports = [
    ./settings/zsh.nix
    ./settings/kitty.nix
    ./settings/tmux.nix
    ./settings/neovim.nix
  ];
# ... with the rest of code
# modules/home-manager/settings/neovim.nix
{ pkgs, ... }: {
  programs.nixvim = {
    enable = true;

    colorschemes.kanagawa.enable = true;
  };
}
traxys commented 8 months ago

That is (I think) a real nixvim issue

lanjoni commented 8 months ago

That is (I think) a real nixvim issue

Ok! I changed the issue title now. Thanks for your help in advance! If I have any updates I will send here (if you have any updates, please send here).

traxys commented 8 months ago

Ok so the issue is that https://github.com/NixOS/nixpkgs/pull/285828 was merged recently, is present in nixpkgs-unstable, but not yet in nixos-unstable (which we target).

So to fix your issue you could use nixos-unstable as a nixpkgs reference.

lanjoni commented 8 months ago

Ok so the issue is that NixOS/nixpkgs#285828 was merged recently, is present in nixpkgs-unstable, but not yet in nixos-unstable (which we target).

So to fix your issue you could use nixos-unstable as a nixpkgs reference.

Great, but, how can I do this? And, I need to add this reference only for nixvim?

c0h2r commented 8 months ago

Ok so the issue is that NixOS/nixpkgs#285828 was merged recently, is present in nixpkgs-unstable, but not yet in nixos-unstable (which we target).

So to fix your issue you could use nixos-unstable as a nixpkgs reference.

Nope, it's in nixos-unstable as well: https://github.com/NixOS/nixpkgs/commit/3a19a727c8df98da4e0494bf2a1db50412df6a01

traxys commented 8 months ago

It has just landed I think (https://nixpk.gs/pr-tracker.html?pr=285828).

c0h2r commented 8 months ago

So, I believe the temporary solution would be to set

    nixpkgs.url = "github:NixOS/nixpkgs/d8e0944e6d2ce0f326040e654c07a410e2617d47";

(which is right before that PR landed) until the issue's resolved or something?

Edit: well, at least it builds. Although it was probably better to just make nixvim follow that particular revision.

GaetanLepage commented 8 months ago

Fixed by https://github.com/nix-community/nixvim/pull/1168

budimanjojo commented 8 months ago

Now I got a new error:

       error: attribute 'php-codesniffer' missing

       at /nix/store/7nqyi3z1i7d5rpf1nb0v1ymmdhhamav3-source/plugins/none-ls/servers.nix:196:19:

          195|       phpcbf = {
          196|         package = pkgs.phpPackages.php-codesniffer;
             |                   ^
          197|       };

Ah sorry my bad, ignore me.

drupol commented 8 months ago

Sorry for the troubles guys, this thing was a long overdue... and it has to be done one day or another. Glad it has been fixed!

meisme-dev commented 8 months ago

Now I got a new error:

       error: attribute 'php-codesniffer' missing

       at /nix/store/7nqyi3z1i7d5rpf1nb0v1ymmdhhamav3-source/plugins/none-ls/servers.nix:196:19:

          195|       phpcbf = {
          196|         package = pkgs.phpPackages.php-codesniffer;
             |                   ^
          197|       };

Ah sorry my bad, ignore me.

how did you fix this?

traxys commented 8 months ago

nix flake update I'd wager