Github Copilot Extension in VSCode is not working because of OS Keyring and/or "Cannot read properties of undefined (reading 'map')"

I’m a complete nixos noob, trying to use the GitHub Copilot Extension in VSCode, and I’m having a rough time.

Firstly, various login methods just fail. When I click sign button and allow the request, the “Signing in to github.com…” window will open, but no actual browser tab is opened (which is what should happen here, I believe).


I then click “cancel”, giving me this:
image

I try this login method the same way, also doesn’t work. Lastly, I get offered the device code option:
image

This seems to work: I have to open a url manually that probably also should open by itself (or by clicking on it, which also does nothing), then type in the code and the github website reports a success login.

But vscode immediately throws this error: “You’re running in a KDE environment but the OS keyring is not available for encryption. Ensure you have kwallet running.” The Github Copilot chat window is available anyway, but just reports strange errors if used, like “Cannot read properties of undefined (reading ‘map’)”.
image

I tried to activate kwallet (without fully knowing what it is), and then the OS-Keyring error does not come up anymore, but the errors in the chat window stay the same.

Here are what I believe to be the relevant parts of my configuration.nix:

  services.displayManager.sddm.enable = true;
  services.desktopManager.plasma6.enable = true;

 
  services.gnome.gnome-keyring.enable = true;
  security.pam.services.sddm.enableGnomeKeyring = true;

 environment.systemPackages = with pkgs; [
  #  vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
    (vscode-with-extensions.override {
      vscodeExtensions = with vscode-extensions; [
        bbenoist.nix
        ms-python.python
        ms-python.debugpy
        ms-azuretools.vscode-docker
        github.copilot
        github.copilot-chat
      ];
    })
  ];

And this is how I tried to activate kwallet:

  security.pam.services.kwallet = {
    name = "kwallet";
    enableKwallet = true;
  };

I also updated my nixos installation in hopes that would fix things, but it didn’t (the error in the chat window just changed to what it is now. It was similar garbage before). I did the update like this:

    sudo nix-channel --update
    sudo nixos-rebuild switch

I started vscode like this: sudo code --no-sandbox --user-data-dir ~, because I want to edit my configuration.nix in it, and if I don’t start it with sudo, I have to type my password on every save, which drives me insane.

What am I missing? I have tried to follow some advice online, switching between gnome and kde, trying to find out what kwallet is and how I activate it, but I’m just completely out of ideas. Help would be greatly appreciated!!

I have the same issue with Github copilot giving the error "Cannot read properties of undefined (reading ‘map’), and I have not found a solution.

With regards to your problem of editing the configuration in vscode, I moved my main config out to a directory in the home directory, and then I imported that into my configuration in /etc/nixos/. Then I only edit the config in my home directory. I also created a rebuild script that automates a lot of it for me, formats it and commits it. Works like a charm