{ pkgs
, lib
, config
, ... }: with lib; let
  cfg = config.passthrough.vscode;
  theme = config.passthrough.catppuccin.enable;
in mkIf cfg.enable {
  programs.vscode = {
    enable = true;
    mutableExtensionsDir = false;
    enableUpdateCheck = false;
    enableExtensionUpdateCheck = false;
    package = pkgs.vscodium;
    extensions = with pkgs.vscode-extensions; [
      catppuccin.catppuccin-vsc catppuccin.catppuccin-vsc-icons
      bbenoist.nix golang.go rust-lang.rust-analyzer
    ];
    userSettings = {
      "workbench.colorTheme" = mkIf theme "Catppuccin Mocha";
      "workbench.iconTheme" = mkIf theme "catppuccin-mocha";
      "[nix]"."editor.tabSize" = 2;
    };
  };
}
