Getting error: " 'rnix-lsp' has been removed as it is unmaintained" while trying to update from 23.11 to 24.05

Problem here is I don’t have rnix-lsp installed anywhere.

building the system configuration...
error:
       … while calling the 'head' builtin

         at /nix/store/i3nnamjy3zl9qx90wfsxq3zqdw2q3l50-source/lib/attrsets.nix:1575:11:

         1574|         || pred here (elemAt values 1) (head values) then
         1575|           head values
             |           ^
         1576|         else

       … while evaluating the attribute 'value'

         at /nix/store/i3nnamjy3zl9qx90wfsxq3zqdw2q3l50-source/lib/modules.nix:809:9:

          808|     in warnDeprecation opt //
          809|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          810|         inherit (res.defsFinal') highestPrio;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: 'rnix-lsp' has been removed as it is unmaintained

My flake.nix:

{
	description = "'s NixOS Flake configuration.";

	inputs = {
		nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
		nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";

		home-manager = {
			url = "github:nix-community/home-manager/release-24.05";
			inputs.nixpkgs.follows = "nixpkgs";
		};

		nixvim = {
    			url = "github:nix-community/nixvim/nixos-23.11";
    			inputs.nixpkgs.follows = "nixpkgs";
  		};
	};

	outputs = inputs@{ nixpkgs, nixpkgs-unstable, home-manager, nixvim, ... }: let inherit (import ./variables.nix) username hostname systemarch; in {
		nixosConfigurations = {
			${hostname} = nixpkgs.lib.nixosSystem {
				system = "${systemarch}";
				modules = [
					({ config, pkgs, ... }:
					let overlay-unstable = final: prev: {
						unstable = import inputs.nixpkgs-unstable {
							system = final.system;
							config.allowUnfree = true;
						};
					};
					in { nixpkgs.overlays = [ overlay-unstable ]; })

					/etc/nixos/hardware-configuration.nix

					./modules/system # points to default.nix in that directory

					home-manager.nixosModules.home-manager {
						home-manager.useGlobalPkgs = true;
						home-manager.useUserPackages = true;
						home-manager.sharedModules = [
              				nixvim.homeManagerModules.nixvim
						];
						home-manager.users.${username} = import ./modules/home;
					}
				];
			};
		};
	};
}

Maybe its being pulled in as a dependency of something?

Perhaps a command like

nix why-depends --derivation .#nixosConfigurations.<your-hostname>.config.system.build.toplevel nixpkgs#rnix-lsp

will tell you what is pulling it into the system closure.

> sudo nix why-depends --derivation .#nixosConfigurations.nixos.config.system.build.toplevel nixpkgs#rnix-lsp --impure
error:
       … while evaluating a branch condition

         at /nix/store/l4wskml8vcs49mg6w9la715cx10sviwh-source/pkgs/top-level/aliases.nix:33:5:

           32|   removeDistribute = alias: with lib;
           33|     if isDerivation alias then
             |     ^
           34|       dontDistribute alias

       … while evaluating a branch condition

         at /nix/store/l4wskml8vcs49mg6w9la715cx10sviwh-source/pkgs/top-level/aliases.nix:26:5:

           25|   removeRecurseForDerivations = alias: with lib;
           26|     if alias.recurseForDerivations or false
             |     ^
           27|     then removeAttrs alias [ "recurseForDerivations" ]

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: 'rnix-lsp' has been removed as it is unmaintained

This also gives same output.

I found that it was caused by NixVim (even though I didn’t enable rnix-lsp). Seems like I should wait for an update for NixVim.

I understand that nixvim will create a 24.05 branch sometime soon (see here).

As suggested in that issue I have been using the nixvim main branch successfully, but will use the 24.05 branch when it’s available.

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