{ config, pkgs, lib, libs, ... }: let extensions = with pkgs.vscode-extensions; [ bierner.markdown-mermaid esbenp.prettier-vscode foxundermoon.shell-format github.copilot github.copilot-chat golang.go jnoortheen.nix-ide pkief.material-icon-theme ] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [ ]; in { imports = [ ]; programs = { vscode = { enable = true; } // (if lib.versionAtLeast config.home.stateVersion "25.05" then { profiles.default = { inherit extensions; }; } else { inherit extensions; }); }; # 使用map函数循环 conf 变量,动态的生成 home.file..config.${i} xdg.configFile = builtins.listToAttrs (builtins.map (name: { name = "Code/User/${name}"; value = { source = config.home-libs.mkOutOfStoreSymlink "modules/home/vscode/conf/${name}"; }; }) (builtins.attrNames (builtins.readDir ./conf)) ); }