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

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

Closed
1 task done
lanjoni opened this issue Feb 26, 2024 · 14 comments
Labels
bug Something isn't working

Comments

@lanjoni
Copy link

lanjoni commented Feb 26, 2024

Field Description
Plugin all
Nixpkgs unstable
Home Manager unstable
  • I have read the FAQ and my bug is not listed there.

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 
            ];
          };
        }
      ];
    };
  };
}
@lanjoni lanjoni added the bug Something isn't working label Feb 26, 2024
@traxys
Copy link
Member

traxys commented Feb 27, 2024

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

@lanjoni
Copy link
Author

lanjoni commented Feb 27, 2024

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
Copy link
Member

traxys commented Feb 27, 2024

That is (I think) a real nixvim issue

@lanjoni lanjoni changed the title [BUG] error: attribute 'haskell-scope-highlighting-nvim' missing [BUG] error: phpcbf is now deprecated, use php-codesniffer instead which contains both phpcs and phpcbf. Feb 27, 2024
@lanjoni
Copy link
Author

lanjoni commented Feb 27, 2024

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
Copy link
Member

traxys commented Feb 27, 2024

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.

@lanjoni
Copy link
Author

lanjoni commented Feb 27, 2024

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
Copy link

c0h2r commented Feb 27, 2024

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: NixOS/nixpkgs@3a19a72

@traxys
Copy link
Member

traxys commented Feb 27, 2024

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

@c0h2r
Copy link

c0h2r commented Feb 27, 2024

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
Copy link
Member

Fixed by #1168

@budimanjojo
Copy link
Contributor

budimanjojo commented Feb 28, 2024

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.

budimanjojo added a commit to budimanjojo/nix-config that referenced this issue Feb 28, 2024
ref: nix-community/nixvim#1160

Signed-off-by: budimanjojo <budimanjojo@gmail.com>
@drupol
Copy link

drupol commented Feb 28, 2024

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
Copy link

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
Copy link
Member

traxys commented Feb 29, 2024

nix flake update I'd wager

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants