Nothing fancy, I just put

programs.vscode.enable = true;

in home manager config. I am presented with this error after a successful rebuild switch.

[1117/114505.763499:FATAL:v8_initializer.cc(538)] Error loading V8 startup snapshot file
/nix/store/1lqh595004maiapcx72wkp65r1nbnh9n-vscode-1.84.2/bin/.code-wrapped: line 63: 39906 Trace/breakpoint trap   (core dumped) ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" --ms-enable-electron-run-as-node "$@"

I have tried a lot of fixes, from reinstalling, to adding some custom settings in vscode config. Nothing seems to work. Thanks in advance! If you want any additional information, let me know.

  • @_nix-addictB
    link
    fedilink
    English
    18 months ago

    I’m using Nvidia with Hyprland.

    I had troubles with vscode, I don’t actually use the program but the last time I checked this was working for me:

    { pkgs, home-manager, username, ... }:
    {
        home-manager.users.${username} = { pkgs, ... }: {
        # VS Code on Wayland has issues, make sure to set the title bar to custom
        # https://github.com/microsoft/vscode/issues/181533
        programs.vscode = {
          enable = true;
          enableUpdateCheck = true;
          enableExtensionUpdateCheck = true;
          extensions = with pkgs.vscode-extensions; [
            golang.go
            vscodevim.vim
            github.copilot
            github.github-vscode-theme
            github.vscode-github-actions
            #ms-python.python
            ms-vscode.powershell
            bbenoist.nix
          ];
          userSettings = {
             "window.titleBarStyle" = "custom";
             "workbench.colorTheme" = "Github Dark Colorblind (Beta)";
             "editor.fontFamily" = "'M+1Code Nerd Font','Droid Sans Mono', 'monospace', monospace";
             "github.copilot.enable" = {
               "*" = true;
               "plaintext" = false;
               "markdown" = true;
               "scminput" = false;
             };
             "powershell.powerShellAdditionalExePaths" = "/run/current-system/sw/bin/pwsh";
          };
        };
      };
    }
    
    • @ManasLmao_OPB
      link
      fedilink
      English
      17 months ago

      Sorry, I couldn’t access my Nix for sometime. I’ll check right away.

      • @_nix-addictB
        link
        fedilink
        English
        17 months ago

        Do you have these environment variables anywhere else? This is the only other setting I have that even interacts with electron or wayland:

        # Force wayland when possible
        environment.sessionVariables.NIXOS_OZONE_WL = "1";

        It might be worth it to try clearing the electron cache and to do a nix-collect-garbage -d if you dont have any old generations you need to keep around.

        rm -rf ~/.electron

        These are just guesses and the next steps that I would take to troubleshoot. I’m sorry I couldn’t be of more help!

        • @ManasLmao_OPB
          link
          fedilink
          English
          17 months ago

          Hi, I updated my flake, and now vscode launches with these settings. Thanks a lot man!

          For people arriving here, update you flake with : nix flake update

    • @ManasLmao_OPB
      link
      fedilink
      English
      18 months ago

      I’ve checked that, tried reinstalling as well. No luck.