Error: Alias bash-language-server is still in node-packages.nix

Nix build error:

➜  sudo nixos-rebuild switch --upgrade --flake $HOME/nixos
error:
… while calling the 'head' builtin

at /nix/store/qqwr649pc0qprc9lw2fmdsi1km6p7q2h-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/qqwr649pc0qprc9lw2fmdsi1km6p7q2h-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: Alias bash-language-server is still in node-packages.nix

How can I find the source of the problem? I assume nixvim, but I’m not really sure.

1 Like

Related to:

I believe a fix is currently being worked on in PR #319882

2 Likes

Looks like it’s merged. Awesome. Any idea how long it takes to be released?

Edit: The fix has been merged in nixos-unstable. Updating nixpkgs should be enough, now.


I don’t really know. You can track when it reaches nixos-unstable here, but until then you might want to overlay the package with the changes from the PR.

For example, if you’re using flakes, you can define a different nixpkgs input which points to the commit that fixes the package:

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    nixpkgs-fixes.url = "github:NixOS/nixpkgs/91a7822b04fe5e15f1604f9ca0fb81eff61b4143";
  };

Then in configuration.nix, you overlay the package:

{ inputs, ... }:
{
  nixpkgs.overlays = [
    (final: prev: {
      nodePackages = prev.nodePackages // {
        inherit (inputs.nixpkgs-fixes.legacyPackages.${prev.system}.nodePackages) bash-language-server;
      };
    })
  ];
}

Just don’t forget to add inputs to specialArgs.

4 Likes