VS Code extension trying to copy files in nix-store

Hi, sort-of newbie here,

I am trying to run use the VS Code extension “katsute.code-background” like this:

programs.vscode.profiles.${profile} = {

    extensions = pkgs.vscode-utils.extensionsFromVscodeMarketplace [
      {
        name = "code-background";
        publisher = "katsute";
        version = "3.1.1";
        sha256 = "sha256-HCSQi1EIXD1O/cIpM35HG+gmahKpDN+mt4FG0qT10lc=";
      }
    ];

    userSettings = {
      "background.useInvertedOpacity" = true;
      "background.autoInstall" = false;
    };

  };

with a background like this

programs.vscode.profiles.${profile} = {

    userSettings = {
      "background.windowBackgrounds" = [
        "${pkgs.fetchurl {
          url = "https://w.wallhaven.cc/full/qz/wallhaven-qzv6rd.jpg";
          hash = "sha256-2agGcbQS3oUcdvnQM0VP1YBQwG0RFBYr4A63KLTmMIU=";
        }}"
      ];
      "background.backgroundAlignment" = [
        "Top Center"
        "Center Center"
        "Center Center"
        "Center Center"
      ];
      "workbench.localHistory.enabled" = true;
      "settingsSync.ignoredExtensions" = [
        "katsute.code-background"
      ];
    };

  };

When I try to run the Install Background command from the extension I get the following error:

I believe the cause is that the extension wants to be nice and save the workspace layout before reloading the window (?)

Is there a way to mitigate this behaviour of extensions?

Yes, patch them to not do that.

I just opened a feature request for a toggle that turns off such writes to VS Code’s source files location… lets see where this goes :person_cartwheeling:

the issue

Alright looks like this this extension cannot work without modifying the source files :frowning:

Does anyone know of a background image extension that works on NixOS?

These are the ones I’ve tried so far and had no success:

extensions = pkgs.vscode-utils.extensionsFromVscodeMarketplace [
      # {
      #   name = "background-cover";
      #   publisher = "manasxx";
      #   version = "2.7.0";
      #   sha256 = "sha256-5sFtFiq0ocV0x/OfhW50hvSz0IXXRn8MK5Jd6zC5F48=";
      # }
      # {
      #   name = "background";
      #   publisher = "thomaszhang";
      #   version = "1.1.1";
      #   sha256 = "sha256-aB1rdCp2csyDIV7XgGMJnP6bKUiENI5Ortt2dnE960M=";
      # }
      # {
      #   name = "background";
      #   publisher = "shalldie";
      #   version = "2.0.3";
      #   sha256 = "sha256-tvGHJvU3vJqlx5bHP8xxTfdKw9s9etevV1pLo2Xd8DI=";
      # }
      # {
      #   name = "code-background";
      #   publisher = "katsute";
      #   version = "3.1.1";
      #   sha256 = "sha256-HCSQi1EIXD1O/cIpM35HG+gmahKpDN+mt4FG0qT10lc=";
      # }
    ];